[SIZE=2][FONT=Arial]Hello everyone,
I used the below actionscript for one button with one sound so how to write as3 three different buttons with three different sound?
Any help would be greatly appreciated.
[/FONT][/SIZE][SIZE=2][FONT=Arial] Thanks,
var loadSnd:URLRequest = new URLRequest(“SORTER.mp3, GUITAR.mp3, STACKER.mps”);
var thisSnd:Sound = new Sound();
var sndTrans:SoundChannel = new SoundChannel();
thisSnd.load(loadSnd);
play_btn.addEventListener(MouseEvent.CLICK, playF);
stop_btn.visible = false;
stop_btn.addEventListener(MouseEvent.CLICK, stopF);
function playF(event:MouseEvent):void{
SoundMixer.stopAll();
sndTrans = thisSnd.play();
play_btn.visible = false;
stop_btn.visible = true;
}
function stopF(event:MouseEvent):void{
sndTrans.stop();
stop_btn.visible = false;
play_btn.visible = true;
[/FONT][/SIZE]