homepage Welcome to WebmasterWorld Guest from 54.166.148.189
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
can't stop ENTER FRAME event
moghes




msg:4431059
 10:50 pm on Mar 19, 2012 (gmt 0)

I am making a small game.
at level 2 the player will click on objects before the time expires.

when the time expires, I am moving the main timeline to a frame where there is the game over animation.

My problem is that after the game over page is displayed, the loop(enterframe) function is still being called.

I don't understand how the function is being called, since the main timeline moved to the next frame?
any suggestion?
here's the code:


var obj:MovieClip=this.parent as MovieClip;

key_mc.addEventListener(Event.ENTER_FRAME, level3loop);

function level3loop (e:Event)
{
counter++;
if(counter == 24)
{
counter = 0;
time--;
}
if(time == 0)
{
obj.gotoAndStop('gameover');
this.stop();
trace("levle 3 loop playing");
}
level3TimerTextBox.text = "Time Left: " + time + "sec";
}

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved