I am developing a video game for my flash class. This code is not working:
public function onEvent(e:Event){
...
if (constrictMovement){
bear.gotoAndStop("power");
}
if (bear.bearP.currentFrame >= bear.bearP.totalFrames){ // the biggest error is here?
constrictMovement = false;
}
}
bear is already a variable to a "parent" symbol, containing three "child" symbols (each play a different animation)
bearP is the instance name of target symbol within a parent symbol.
constrictMovement is a switch to prevent keyboard input during the event animation is played.
Everything works fine except for this code snippet. The animation should only complete one cycle, instead of repeating. The switch, constrictMovement should break the repeats by turning bear.gotoAndStop("power") off and activating other parts of code with a !constrictMovement.
What am I doing wrong? :/ Any help is appreciated, thanks.