Play/stop MP3
i'm doing sort of ipod , have little problem code. in every keyframe have code below diferents songs. problem have click play button , start playing. click next , when click play song songs overlap. how can stop whatever song playing , start playing new one? has stop prev song when click play_brn.
tx
stop();
prev_btn.addeventlistener(
mouseevent.mouse_up,
function(evt:mouseevent):void {
gotoandstop("samba");
}
)
next_btn.addeventlistener(
mouseevent.mouse_up,
function(evt:mouseevent):void {
gotoandstop("limon");
}
)
play_btn.addeventlistener(mouseevent.click,sunday);
function sunday(e:mouseevent)
{
var s:sound = new sound();
var req:urlrequest = new urlrequest("sunday.mp3");
var context:soundloadercontext = new soundloadercontext(8000, true);
s.load(req, context);
s.play();
}
use soundchannel class play sounds - provides more control.
More discussions in ActionScript 3
adobe
Comments
Post a Comment