variable updates in the next frame so life never decreases
i want my game 2 times trail . i can't replay once my game reaches to 0.
look the below code will never fill the goal and life never decreases . because once it goes to frame2 after executing game logic in frame1 . the value of life becomes 2 again . it never decreases. Any idea or suggestion to fix the issue ?.
// frame2
var life:Number=3;
life=life-1;
lifetxt.text=String(life);
trace(life);
if(life!=0) {
Replay_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_44);
function fl_MouseClickHandler_44(event:MouseEvent):void
{
gotoAndStop("frame1");
life=life-1;
}
}
