actionscript 3 - as3; stop bg sound after replay game; avoid overlapping sound -
i've made little quiz school project. stuck sound issues. want play background sound when player hit start btn on start screen. after game finished, can replay it. when come start screen sound still playing und when hit start btn again, sounds overlapping. best be, after clicking replay btn sound stops. , when click start btn sound start again. code start screen far:
stop(); var bgsound:sound = new bgsnd(); var bgchannel:soundchannel = new soundchannel(); start_btn.addeventlistener(mouseevent.click, start_quiz) function start_quiz(event:mouseevent):void{ nextframe(); bgchannel = bgsound.play(); } function rebtnf(event:mouseevent):void{ gotoandstop(1); bgchannel.stop(); }
the replay btn start function rebtnf. works frame 1, sound continues play.
can me? hope so!
one love, monkeycel
Comments
Post a Comment