Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoadMovie(swf file) into a MC doesn't work, but into a level does.

Status
Not open for further replies.

vijeshmehta

Programmer
Apr 16, 2003
1
US
My problem is that if I load a swf file into a level, it functions perfectly (executing actionscript). If I load the same swf file into an empty movie clip created at runtime, the swf file displays, but none of the actionscript in the imported swf executes.

(Error Code) =
Frame 1:
_root.createEmptyMovieClip("test",20);
Frame 2:
test.loadMovie("mainmenu.swf");
stop();

I don't get anything except the background on the mainmenu.swf

(Works when loaded into level)
Frame 1:
loadMovie("mainmenu.swf","_level1");

this functions fine. Is there something I need to know in order to load a swf into a MC and make it execute properly?
 
You must have a lot of references to _root. They should be change to this and in some other cases you might have to use _parent.

No problem when loading this movie on another level, since every movie has it's own _root level, so references to _root keep on working in that case.

When loading in an empty container clip, any references to _root now point to the _root level of the movie which holds the container clip, and no more to the _root level of the external movie loaded in that container clip.

But why do you insist in loading your movie in a container clip? Loading on a level does work as well and without script changes!

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top