I want to be able to stop a function from running by the press of a button.
Is there such an inbuilt function?
Like “stop function(myFunction);” or something…?
I want to be able to stop a function from running by the press of a button.
Is there such an inbuilt function?
Like “stop function(myFunction);” or something…?
where is it running?
Its running in a swf that is loaded to the main swf with the loadMovieNum() function.
It can be accessed via _root.myFunction().
what does the function do?
if you want to stop it from running always, you can just do this:
myButton.onRelease = function(){
_root.myFunction = null;
//or:
_root.myFunction = function(){
}
}
i’d make the function dynamic (as in you assign the function from somewhere else, not on the actual object or whatever), this way, you can delete it when you want…like…
mc.onEnterFrame = function () {
trace("what's the best way to annoy you?");
};
then later on…
delete mc.onEnterFrame;
Well, I dont want to remove the function, I just want to stop it from executing if its in the middle of execution.
It is a rather large function that takes some time in executing, and it is called every time I change to a new page (browser arrows). So when I update with the next/previous page, the same function is called again, but with slightly different parameters (overloading).
The problem Im having now, though, is that if the function is in the middle of execution, and it is called again at that time (overloaded), the first instance of the function (the one running) will not stop executing, but continue along with the execution of the next function-call.
So what I really want is for the browser-button to FIRST stop the running function, and THEN call the function again (with new parameters).
:: Copyright KIRUPA 2024 //--