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!

freaky loading swf into empty clip

Status
Not open for further replies.

krosshair

Programmer
Feb 28, 2003
34
GB
Hi all - can anyone help me here?

I am using the correct form of loading a swf into flash
ie. loadMovie ("knw.swf" , "empty");

And it works fine with other movies I have loaded in. However the one movie I am trying to get on stage is not playing (nothing) - although if I just load it as a movie clip ie. loadMovie ("knw.swf", 1) it runs perfectly fine!!

The movie in question has all its elements on the first frame if that makes any difference - although I tried moving to frame two and it did not make a difference.

Any ideas?? Thanks very much!!
 
When using loadMovie("knw.swf", 1); (the correct syntax would actually be loadMovieNum("knw.swf", 1);), your are loading an external .swf (not a movie clip as your calling it!), on level 1 of your main movie.
If it then works, loaded on a level rather than in an empty container clip, it's most probably because in "knw.swf", you've used references to _root, which when loaded in a empty container clip (as opposed to on another level), point to the main timeline of your main movie in which this external movie is loaded, rather than to the timeline of the loaded movie itself.
All those references have to be changed for this and/or 1 or more _parent depending on the code.

If you don't want to change your scripts, then load your movie on a level, rather than in a container clip.
 
Thanks very much - I changed all the refrences to this in the .swf to be loadded into the "empty" movie clip - unfortunately it is still not working :(

So if it is working if I load it into a layer is there a way I can position the movie on the stage if it is not in a empty clip?
 
You wouldn't be loading on a layer but on another level...


And yes, if you use loadMovieNum("knw.swf", 5); - you would be loading on level 5 (you have up to 16,000 levels to work with), which is on "top" of level 4, 3, 2, 1 and level 0 which is the main movie's level - and you can easily preposition the "to be loaded" movie , by adding the following on it's first frame (knw.fla)...

this._x = 150; // offset from top-left corner of main movie
this._y = 200; // offset from top-left corner of main movie

You'll have to play around with those numbers until you get the position you want, but it works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top