estoy intentando editar un template de flash para que toque la musica al cargar el template (autoplay) ya que solo toca la musica si le das al boton de play, he encontrado lo que es el apartado del action script del template para poder editarlo que os lo pongo abajo pero lo que nose es como puedo editarlo para que realmente me haga eso.
Código:
stop(); import gs.*; import gs.easing.*; import flash.events.*; MovieClip(root).main.soundControll(fullSound); var nextReq:URLRequest = new URLRequest(MovieClip(root).main.websiteXML.mp3List.sfx[MovieClip(root).main.soundCurId].@imageUrl); MovieClip(root).main.nextTitle = new Sound(nextReq); MovieClip(root).main.channel = MovieClip(root).main.nextTitle.play(1,99999,MovieClip(root).main.st); playButt.gotoAndPlay('st1'); var isPause:Boolean=false; setTimeout(function():void{pauseButt.dispatchEvent(new MouseEvent(MouseEvent.CLICK));},100); ////////////////////////////////////////// pauseButt.addEventListener(MouseEvent.MOUSE_OVER,pauseOver); pauseButt.addEventListener(MouseEvent.MOUSE_OUT,pauseOut); function pauseOver(e:Event):void{ if(!isPause){ pauseButt.gotoAndPlay('st1');} } function pauseOut(e:Event):void{ if(!isPause){ pauseButt.gotoAndPlay('st2'); } } playButt.addEventListener(MouseEvent.MOUSE_OVER,plOver); playButt.addEventListener(MouseEvent.MOUSE_OUT,plOut); function plOver(e:Event):void{ if(isPause){ playButt.gotoAndPlay('st1'); } } function plOut(e:Event):void{ if(isPause){ playButt.gotoAndPlay('st2'); } } playButt.addEventListener(MouseEvent.CLICK,playClick); prevButt.addEventListener(MouseEvent.CLICK,prevClick); nextButt.addEventListener(MouseEvent.CLICK,nextClick); pauseButt.addEventListener(MouseEvent.CLICK,pauseClick); ////////////////////////////////////////// function prevClick(e:Event):void{ if(MovieClip(root).main.soundCurId!==0){ if (isPause){playButt.gotoAndPlay('st1'); pauseButt.gotoAndPlay('st2'); fullSound.gotoAndStop('off'); MovieClip(root).main.soundTitle = true; isPause=false;MovieClip(root).main.soundTitle = true; TweenLite.to(MovieClip(root).main.st, 1, {volume:1, onUpdate:MovieClip(root).main.updateChannel});} MovieClip(root).main.soundCurId--; MovieClip(root).main.channel.stop(); nextReq=new URLRequest(MovieClip(root).main.websiteXML.mp3List.sfx[MovieClip(root).main.soundCurId].@imageUrl); MovieClip(root).main.nextTitle = new Sound(nextReq); MovieClip(root).main.channel = MovieClip(root).main.nextTitle.play(1,99999,MovieClip(root).main.st); } } function playClick(e:Event):void{ if (isPause){MovieClip(root).main.channel=MovieClip(root).main.nextTitle.play(); isPause=false; pauseButt.gotoAndPlay('st2'); fullSound.gotoAndStop('off'); MovieClip(root).main.soundTitle = true; TweenLite.to(MovieClip(root).main.st, 1, {volume:1, onUpdate:MovieClip(root).main.updateChannel}); } } function pauseClick(e:Event):void{ if (!isPause){MovieClip(root).main.channel.stop(); isPause=true; playButt.gotoAndPlay('st2'); fullSound.gotoAndStop('on'); MovieClip(root).main.soundTitle = false; TweenLite.to(MovieClip(root).main.st, 1, {volume:0, onUpdate:MovieClip(root).main.updateChannel}); } } function nextClick(e:Event):void{ if(MovieClip(root).main.soundCurId<int(MovieClip(root).main.websiteXML.mp3List.sfx.length()-1)){ if (isPause){playButt.gotoAndPlay('st1'); pauseButt.gotoAndPlay('st2'); fullSound.gotoAndStop('off'); MovieClip(root).main.soundTitle = true; isPause=false; MovieClip(root).main.soundTitle = true; TweenLite.to(MovieClip(root).main.st, 1, {volume:1, onUpdate:MovieClip(root).main.updateChannel}); } MovieClip(root).main.soundCurId++; MovieClip(root).main.channel.stop(); nextReq=new URLRequest(MovieClip(root).main.websiteXML.mp3List.sfx[MovieClip(root).main.soundCurId].@imageUrl); MovieClip(root).main.nextTitle = new Sound(nextReq); MovieClip(root).main.channel = MovieClip(root).main.nextTitle.play(1,99999,MovieClip(root).main.st); } }
Mil besos y gracias