Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-13-2007, 04:10 PM   #1
maximum rinse
Registarded User
Join Date: Sep 2006
Location: Brighton
Posts: 66
Default Restarting my onEnterFrame after Interval actions

Hi all,

I'm working on a game at the moment that relies on 'onEnterFrame' scripted animation.
At the end of the round I have been forced to delete the 'onEnterFrame', and opt for a 'launchInterval' system in order to display the scoring screen (because it requires repetitive actions with delays in between them).

Now I want create successive levels for this game. They will be pretty much the same as level 1, only with some minor setting changes.

Please can somebody advise on the best way to restart my 'onEnterFrame' (including timer etc)?
Am I barking up the wrong tree here, and should I be looking at alternative techniques, or is this easily do-able?

Many thanks in advance for any suggestions!!

maximum rinse is offline   Reply With Quote
Old 04-13-2007, 05:37 PM   #2
Banned by AS.org Staff
Join Date: Mar 2007
Location: PAK
Posts: 11
Send a message via MSN to flashwizardz Send a message via Yahoo to flashwizardz

hi there,
you should use a flag variable inside the onEnterframe script that if the level change then the the code cant make effect


once the round clear set flag = 1;

if (flag == undefined)
// Do the Action

OR Next And Strong Way is you create a movieClip (controller)m placew another movieclipinside (the inner mcClip contain the onEnterFrame script)
present on the 1st frame,

when round clear mcController.gotoAndStop(2),// on that frame the inner mcCLip doesnt exist so the Script will not disturb.....

[email protected]
flashwizardz is offline   Reply With Quote
Old 04-15-2007, 09:46 AM   #3
maximum rinse
Registarded User
Join Date: Sep 2006
Location: Brighton
Posts: 66

FlashWizards, thanks for your suggestion. I'm not keen on spreading my code around different movieClips, so I'm having a look at your first option.

Do you mean that I include: "delete this.onEnterframe;" and "launchInterval();" and all the interval stuf where you say "//Do the action" in your example?
maximum rinse is offline   Reply With Quote
Old 04-16-2007, 08:32 AM   #4
maximum rinse
Registarded User
Join Date: Sep 2006
Location: Brighton
Posts: 66

Ok think I've managed to sort this one out.

I've ditched the whole onEnterFrame function in favour for the following technique, and as such can be restarted after the setInterval actions:

thing_mc.onEnterFrame = function
For more info check this link:

maximum rinse is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dev Kit, Interval Manager... here you go MichaelxxOA ActionScript 2.0 1 08-03-2006 11:22 PM
onEnterFrame vs interval... drexle ActionScript 2.0 15 01-30-2006 11:23 AM
onEnterFrame question jwilly ActionScript 2.0 3 07-27-2005 03:52 PM
interval vs onEnterFrame webguy ActionScript 1.0 (and below) 8 09-05-2003 06:52 PM
How to use classes, without using movieClip.prototype?? agent81 ActionScript 1.0 (and below) 14 05-30-2003 01:35 PM

All times are GMT. The time now is 04:31 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.