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

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO