var Sound = Class.create(SWFControl, { initialize: function($super, id){ $super(id, {"width": 1, "height": 1, "url": "/flash/sound.swf"}); }, Play: function(loops){ var swfobject = this.GetSWF(); if (swfobject && swfobject.Start) swfobject.Start(loops || 0); else{ if (typeof loops != "undefined") this.action_ = ["Start", loops]; else this.action_ = "Start"; } }, Pause: function(){ var swfobject = this.GetSWF(); if (swfobject && swfobject.Pause) swfobject.Pause(); else this.action_ = "Pause"; }, Stop: function(){ var swfobject = this.GetSWF(); if (swfobject && swfobject.Stop) swfobject.Stop(); else this.action_ = "Stop"; }, FlashReady: function($super){ $super(); if (typeof this.action_ == "undefined") return; var nam = ""; var args = []; if (Object.isArray(this.action_)){ nam = this.action_.shift(); args = this.action_; }else nam = String(this.action_); var swfobject = this.GetSWF(); if (swfobject && typeof swfobject[nam] === "function"){ swfobject[nam].apply(swfobject, args); delete this.action_; } } });