-
Play sound only once
Hey everyone!
I put a sound starting from frame 1 to the last frame.
In my code I have 2 gotoAndStop() functions
one goes to frame 1 again.
When that happens the sound plays again, so the sound now plays twice. How can I fix it so that that wont happen and the sound only plays once even when going to frame 1 again...
thanks!
-
Try something like this. Put the code in your first frame and add your sound code as shown.
var played:Boolean = false;
if(!played){
played = true;
//add your sound code here
}