flash actionscript:
Not reliable to set variables in an external swf using loadMovie. The
problem is that the load timing is dependent on the network and not the
script. The loadMovie line does not pause the script until the external swf
is loaded. Thus the next line looking for the external swf can and probably
does execute before the movie is loaded.
You want to look at MovieClipLoader Actionscript class as a technique for
detecting when an external movie is loaded and ready for Actionscript.
An overview appears at
http://livedocs.macromedia.com/flash/8/main/00002538.html Probably the example for onLoadComplete is a good place to start:
http://livedocs.macromedia.com/flash/8/main/00002543.html However if you want to start using before the entire movie is loaded, you
can look ot onLoadInit also shown in the onLoadComplete example.
In the onLoadComplete method you can have targe_mc.thisVar = 1;
There are also other customized techniques using onEnterFrame and
setInterval to monitor the presence of a loaded external swf that you can
pursue.
--
Lon Hosford
www.lonhosford.com Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com May many happy bits flow your way!
[quoted text, click to view] "g1r2e3g" <webforumsuser@macromedia.com> wrote in message
news:e64iv5$mf3$1@forums.macromedia.com...
So i have one main swf, that dynamically loads in several copies of another
swf.
Within the Child movie there are buttons that call out to the HTML to
various
JavaScript functions, I need each instanct of the Child movie to have a
unique
ID variable set by the container film..
Can someone show me a working version of the following as I cannot find
anything that can pass a variable to the child.
_root.createEmptyMovieClip("child1",1);
loadMovie("child.swf","child1");
child1.thisVar = 1;
_root.createEmptyMovieClip("child2",2);
loadMovie("child.swf","child2");
child2.thisVar = 2;