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.
}
}
}
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.
}
}
}