LoadMovie General Question - Please Read

if i create ONE empty movie clip and load several movies into it as follow:


_root.createEmptyMovieClip("containerPreload", 50);
_level.containerPreload._x = 20 ;
_level.containerPreload._y = 20 ;
setProperty ("containerPreload", _alpha, "0"); 

_root.containerPreload.loadMovie("clip1.swf");
_root.containerPreload.loadMovie("clip2.swf");
_root.containerPreload.loadMovie("clip3.swf");

does it…

  1. load all of the movies sequentially
  2. loads only the first and ignores the rest
  3. ignores all but loads the last

if someone could please let me know, it’d be greatly appreciated. thanks.

First of all, you have some glitches in the code. Better code would be:


 var mc = _root.createEmptyMovieClip("containerPreload", 50);
 mc._x = 20;
 mc._y = 20;
 mc._alpha = 0; 
 
 mc.loadMovie("clip1.swf");
 mc.loadMovie("clip2.swf");
 mc.loadMovie("clip3.swf");
 

But that aside.
Here’s what will happen:
clip1.swf is loaded in the created movieclip. Then clip1.swf gets kicked out, and clip2.swf is loaded. And then, clip2.swf gets kicked out, and clip3.swf is loaded. So the result will be a movieclip with clip3.swf in it.

awesome, thanks for the help.

No problem :slight_smile:

So the result will be a movieclip with clip3.swf in it.

Unless you select the layer to load the movie into correct ?

mc.loadMovie(“clip1.swf”,1);
mc.loadMovie(“clip2.swf”,2);
mc.loadMovie(“clip3.swf”,3);

No, loadMovie doesn’t load to depths inside the movieclip. If you’d load each in a seperate movieclip inside mc, then they would all be there, but that can’t be done using the above code.

Sweet I will have to remember that :slight_smile:

voet so what will the code be to load several movieclips so that it doesn’t replace the other swfs. i tried putting each swf into each empty container eg container, container2, etc. but that doesnt seem to work.

It’s simple, all you have to do is use several movieclips instead of one.


this.createEmptyMovieClip("loader1",1);
this.createEmptyMovieClip("loader2",2);
this.createEmptyMovieClip("loader3",3);
loader1.loadMovie("external1.swf");
loader2.loadMovie("external2.swf");
loader3.loadMovie("external3.swf");

That code creates 3 empty movieclips on depths 1, 2 and 3 (make sure these are available or change em), and loads an external swf in each of them. If you test that code, you will only see the third swf if the dimensions of the swfs are the same, because it’s on a higher depth than the others and the positions are the same.

Hi voets thanks for the reply. I know how to do that, just wondering if it was possible not to use depths. So I assume that if a 1swf that is in depth 1 get anywhere in contact(using the same space with 2swf in depth 2 ) 2swf will cancel out 1swf but if they do not occupy the same area than both swfs will show and if i have 3 or four mor swf than they too will show if none of them gets in contact with each other? Am I correct. I guess i would have to put the back ground swf into the main swf

please reply

If you load each one in a different movieclip, then each one will show, except if they overlap (that’s what I meant in the above post). If they overlap then you’ll only see the last one but they’ll all be there. If you load them into the same movieclip then the previous one gets kicked out, and thus only the last one will show.

thanks voets was looking forever to see if i could find a code that acts as layers so that you can see all of them . NOw that i know that it can’t be done i feel like an idiot.
hey, at least I will be sane now.

You can, but you can’t load 'em all in the same movieclip. If you load 'em in seperate movieclips, it’ll work fine, but it’s possible that they overlap.

yeah this is not working as i assume. This overlapping issue also is effected if i created i movieclip that is larger than the stage with a mask effect right. I guess i can’t do that either. Thanks for your help