all groups > flash actionscript > september 2007 >
You're in the

flash actionscript

group:

interval for onEnterFrame


interval for onEnterFrame archloxx
9/12/2007 5:06:20 PM
flash actionscript:
hi all ...

how can i make the onEnterFrame work only for a set of intervals?

my code is

button.onRollOver = function () {
onEnterFrame = function () {
prevFrame();
}
}

--------------
so it goes all the way to the frame 0 ... can i make it work only between a
set of frames? lets say 20 frames???
and keep the rest unaffected with the onEnterFrame


thnx in advance for your help



Re: interval for onEnterFrame Rothrock
9/12/2007 8:37:50 PM
Well you have a nice onEnterFrame happening every frame. So all you have to do
is add some code in there that tells it what you want it to do. I don't know
what you really want it to do, but let's say that when it gets to frame 1
(there is no frame 0!) you would like the onEnterFrame to stop. Inside the
onEnterFrame function you would replace what you currently have with something
like this:

if(this._currentFrame>1){
prevFrame();
} else {
delete this.onEnterFrame;
}

Or if you wanted this to loop you might do something like this:

if(this._currentframe>1){
prevFrame();
} else {
this.gotoAndStop(this._totalframes);
}

The possibilities are endless, you just have to tell Flash what you want to
happen.
Re: interval for onEnterFrame archloxx
9/13/2007 12:00:00 AM
well ... thank you so much ... you made my day :)


Re: interval for onEnterFrame michaeltowse
9/13/2007 12:00:00 AM
AddThis Social Bookmark Button