From: <veg...@ya...> - 2004-06-24 14:53:10
|
> I have read on sourceForge cvs that loadMovie > creates a new namespace ??? > How to access elements in that new namespace ? > [snip] > > Note : I first load the movie "carte" then I > create/update variables with ActionScript, in build > order. > May I reverse that building order ? Beware that the order in which things are executed isn't the same order as they are in code. This is what happens: * loadMovie places request to download and play .swf * you initialise the object which isn't ready yet ... some time later, next frame at the earliest... * the movie is loaded, overwrites everything in the object with its own code, then starts playing So even if you swapped the loadMovie and the init code, the init code will still be destroyed. It is a pain. There is no childclip.onLoad property, and even if there was, when the child clip loads, its own values overwrite the callback function anyway. I've used a crude solution in the past, which is basically: ------ in parent clip: _root.createEmptyMovieClip('foo', 2); _root.foo.loadMovie('http://blah/child.swf', 'GET'); _root.foo_is_loaded = false; _root.onEnterFrame = function () { if (_root.foo_is_loaded) { /* init code */ } }; ------ in child.swf: _root.foo_is_loaded = true; ------ Does this help? Andy > coulas > cou...@ya... > 24/06/2004 ___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com |