Hi everyone,
I am building an app in flash that plays several channels of audio at the same time, some of them have to start later than others, which works fine - until I want to use the pause button, I have tried several different ways to make the sound pause and resume, none successful.
this is the code I used to delay sound b:
ActionScript Code: setTimeout(TimeOut, 15000); function TimeOut() { myChannel_2 = bSound.play(bPosition); }
how can I add a working pause and play function to this? currently I am triggering the sounds with as-code on a "play" frame, so my code for the buttons looks like this:
ActionScript Code: pause_btn.addEventListener(MouseEvent.CLICK, onClickPause);function onClickPause(e:MouseEvent):void{aPosition = myChannel_1.position;bPosition = myChannel_3.position;cPosition = myChannel_3.position;myChannel_1.stop();myChannel_2.stop();myChannel_3.stop();gotoAndStop(2);}play_btn.addEventListener(MouseEvent.CLICK, resumePlaying);function resumePlaying(event:MouseEvent):void{gotoAndStop(4);}
I'd appreciate any help!
pausing/resuming staggered audio channels
Thursday, June 14, 2012
[Action Script] pausing/resuming staggered audio channels June,2012
Posted by Bimo Hery Prabowo at 7:13 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment