hi

just trawling through the posts and don't know if you managed to fix this problem

if you're having problems with unreferenced variables in as2, there is always the _global object to fall back on. It's not a good thing to use all the time but basically you can attach a property and pass the interval to that and you will have access to it wherever you are in your application

it's generally frowned on to use it as it usually means that the structure of your application is unsound (for instance, it may be better to create a function that clears a variable local to the loaded in clip and then call that before you unload the movie) but when you're in a tight spot, it can be the difference between hitting a deadline and not

when you set your interval, do it like this

_global.intervalID = setInterval(this, "myfunc", 2000, functionParameter1, functionParameter2);

and then if you need to get rid of the interval you can use the following
clearInterval(_global.intervalID);

remember tho, if you have several clips trying to set the same _global property you may run into a situation where it gets overwritten and then cannot be cleared so like i said, this is a sticking plaster more than anything else

hope this is useful
ax



On 24 Nov 2009, at 20:10, Andrew Sinning wrote:

I have a movie that is loaded into another movie. The child-movie uses an interval to periodically update itself. My problem is that this continues to get triggered even after the child-movie is unloaded from it's parent. I've tried using an onUnload event in the _root of the child-movie (_lockRoot is true), but it's doesn't seem to get triggered when the child-movie is unloaded.

Thanks!
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to