Skip to main content
June 12, 2006
Question

"if currentframe = # gotoAndStop(blah)"

  • June 12, 2006
  • 2 replies
  • 579 views
I'm tyring to make something happen when a certain frame is hit, rather then if the certain frame is already on.

If there was such thing as a "when" statement, rather then an "if" statement, I'd be using it right now.

In my mind, this is what I want to do:

This topic has been closed for replies.

2 replies

Inspiring
June 12, 2006
In an addition to what kgald has stated you can nest that IF statement inside an onEnterFrame function.

onEnterFrame = function ()
{
if(_root.MYMC._currentframe == 26)
{
SOMEOTHERMC.gotoAndStop("framelabel");
delete onEnterFrame;
}
}

Just make sure you delete the onEnterFrame function when it is no longer needed.
June 12, 2006
Yes, I need to do that, but other then that it's working. How can I delete the function?
kglad
Community Expert
Community Expert
June 12, 2006
the delete onEnterFrame statement does that.
kglad
Community Expert
Community Expert
June 12, 2006
you must initiate a loop and continually check if the _currentframe is 26. use the double equall (==) in your conditional statement.