Skip to main content
Participant
December 14, 2009
Question

delete onEnterFrame does not work

  • December 14, 2009
  • 1 reply
  • 677 views

hi there,

trying to stop the onEnterFrame loop but it won't stop.

this.onEnterFrame = function() {
earth.onRelease = function() {
  if (isMain) {
   if (p>0) {
    delete onEnterFrame;
    gotoAndPlay(openWin);
   } else {
    _dispose();
  }

}else{

  ....

  }
};
};

I'm trying to exit the loop and go to frame openWin but that doesnt jumps so I tried to delete the onEnterFrame  but the loops contiues.

1) how can I exit the loop to frame openWin? thats most importent it's what I need!

2)if I dont use this.onEnterFrame = function(){ just earth.onRelease = function doent work either unless its in the onEnterFrame why?

the earth has animation on it but here i'm using it just as a button so I see no conection to why it isnt working unless its in the onEnterFrame??!?

cheers

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
December 14, 2009

I don't see the sense in using the onEnterFrame code.  That code within it would be assigned regardless of the onEnterFrame, so if you have no other purpose for it, get rid of the onEnterFrame element.  Your problem is not likely related to using the onEnterFrame at all.

In any case, if you assigned "this.onEnterFrame" you should be deleting the same:  delete this.onEnterFrame;

Is openWin a variable or a String?  If it is a String, then it needs to be quoted.

gat724Author
Participant
December 14, 2009

1. I did try without the onEnterFram but it did not work earth.onRelease didnot activate pressing on it does nothing unless I places it in onEnterFrame

this I dont understand?

2. openWin is frame lable

Ned Murphy
Legend
December 14, 2009

Frame labels are strings, so it needs to be quoted if that is the actual label.