PDA

View Full Version : playing through a movie clip without stopping


rastomel
06-29-2008, 05:46 PM
i have a movie clip named "curly" and a button on the stage. when you press the up arrow on hte keyboard, it plays the movieclip "curly". the actionsript on the button looks like this:


on(keypress "<up>"){
curly.gotoAndPlay(1);
}

this works and is ok. the problem is that i want the movieclip "curly" to play straight through to the end. what happens now is that when you press the up arrow while "curly" is playing, "curly" turns off or disappears or something.

how do i get the movieclip to play straight through till the end regardless of what te user does?

please help!

thanks

DiamondDog
06-30-2008, 02:33 PM
What about using a Boolean variable to record the fact that the up key has been pressed once, and testing that variable inside your key press handler.

Something like this:var upKeyPressed:Boolean = false;

on(keypress "<up>"){
if(upKeyPressed == false)
{
upKeyPressed = true;
curly.gotoAndPlay(1);
}
}


Does that work?