Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I stop this function from repeating itself! 1

Status
Not open for further replies.

spook007

Programmer
May 22, 2002
259
US
I've got an object linked to an external script. When the user clicks on the object, this calls the function in question. The only problem is that it continually cycles and never stops and I don't know the command to make it stop. I've tried break and stop, but they don't do anything.

Code on frame:

myObject.onRelease = function(){
myObject.horizontalSlide();
};



Code on external script:

public function horizontalSlide(){
this.onEnterFrame = function(){
if (currentPosition == endposition){
break;
stop();
}else{
//the code for slide action goes here.
}
}
}
 
oldnewbie;

Thank you, I figured it wasn't very complicated... I just couldn't find it anywhere in the documentation. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top