Hey:
I am trying to add a pause function to my game. I am using Tweenlite to animate the objects and utilizing the paused:Boolean method to pause() or resume() the animation.
However, it seems that when i click the pause button, sometimes the animation state (there are three) changes before the pause can fire, so it ‘bypasses’ the pause function and continues to animate.
Is there some way to accommodate for that?
//cycle through the display list to see what employees are on the stage
for(var i:uint=0; i<totalMonitors; i++){
//get the cubicle name
var cubicle_mc:MovieClip;
var cubicle_str:String = "cubicle"+i;
cubicle_mc = this[cubicle_str];
//get the employee that's in the cubicle
var displayName:DisplayObject = cubicle_mc.empty_mc.getChildByName("employeeName") as MovieClip;
trace("displayName = "+displayName);
//pause the animation for whatever does not come up as null(not there)
if(displayName !=null){
MovieClip(displayName).pauseAnim();
trace("pause "+displayName+" not null");
}
}
public function pauseAnim():void{
//trace("pauseAnim");
if(lighteningRound == true){
trace("lighteningRound pause");
isPaused_lr.pause();
} else if(animOut == true){
trace("animOut pause");
//trace("isPaused_out = "+isPaused_out);
isPaused_out.pause();
} else {
trace("pause");
//isPaused_down1.pause();
//isPaused_up1.pause();
isPaused_up2.pause();
}
}
Would an enter frame be too much?