mp3 playback stop echoing, as3
Posted
by pixelGreaser
on Stack Overflow
See other posts from Stack Overflow
or by pixelGreaser
Published on 2010-04-04T19:41:48Z
Indexed on
2010/04/04
20:13 UTC
Read the original article
Hit count: 263
flash
|actionscript-3
Hitting play more than once, causes an echo and I can't stop my mp3 player. What's the best practice for mp3 playback?
var mySound:Sound = new Sound();
playButton.addEventListener (MouseEvent.CLICK, myPlayButtonHandler);
var myChannel:SoundChannel = new SoundChannel();
function myPlayButtonHandler (e:MouseEvent):void {
myChannel = mySound.play();
}
stopButton.addEventListener(MouseEvent.CLICK, onClickStop);
function onClickStop(e:MouseEvent):void{
myChannel.stop();
}
© Stack Overflow or respective owner