PDA

View Full Version : Problem controlling flow of user input.


everlong
04-18-2005, 04:54 PM
I am currently writing a streetfighter style game for my highschool assignment. For each move, I have a seperate movie clip inside a main movie clip which i want to play fully before that movie clip can perform another action (load one of the other movie clips). It seems when i press the button the movie clip will load only as long as i hold it, and if i hold it beyond the end of the movie clip it replays. Is there anyway to get it to fully play the movie clip and only play it once at a time? Thanks for any help in advance

(for an example for better understanding... The movie clip "Jacobs" has 5 movie clips inside of the movie clip. One for standing still, one for walking, one for punching, one for kicking, one for jumping. When i push the punch button i want him to punch once [the whole punch clip] and then return to standing)

everlong
04-18-2005, 05:35 PM
help?

Gibberish
04-18-2005, 05:47 PM
something simple would be just setting a boolean value disallowing the button to function till the value is set to false.

_global.mcIsPlaying = false;

btn.onPress = function(){
if(mcIsPlaying == false){
trace('pressed');
_global.mcIsPlaying = true;
}
}

then at the end of your playing mc set the value back to false to let it play again.

_global.mcIsPlaying = false;

I set the value to global so it could be used for every button and/or mc in your movie, as it is accessible globally. This way all buttons to play a new mc could deactivated.

everlong
04-19-2005, 01:11 PM
Thanks for your response, but i either misunderstood you or see a flaw in this. Disabling all button input until the end of the movie clip would disable the other player from acting at the same time. Is there a way to simply disable a select few keys? One more thing is doing this i don't believe this would play the whole movie clip as i have a keyUp argument at the start setting the characters back to their still state. I'd love to actually show you the program but these crappy computers dont upload very well.