I’ve got one of these going:
Runtime:addEventListener(“enterFrame”, dostuff);
and later on I’ll kill it with one of these:
Runtime:removeEventListener(“enterFrame”, dostuff);
The problem is that even after I kill it the program might still be in the middle of the “dostuff” routine. Therefore, I’d like to kill the listener and then WAIT for the “dostuff” routine to finish running (if applicable) before continuing. We’re talking about just an unnoticable (to the player) instant here, but if I want to do something like nil a variable that is used in “dostuff” for garbage collection I can’t do it immediately after killing the listener if we’re still in the middle of “dostuff” at the time. So I need to kill the listener, wait for any currently running “dostuff” routine to end, then do my thing.
So how do I wait for “dostuff” to finish?
Thanks much!
[import]uid: 5540 topic_id: 24053 reply_id: 324053[/import]
