;

PDA

Click to See Complete Forum and Search --> : [RESOLVED] loadMovie("my.swf")


Ovaire d'Oz
01-18-2008, 12:32 PM
Hello,
I am trying to load a SWF file into another one. In the main one I have this:
web.loadMovie("webb.swf");
In webb.swf I have this:
var i:Number;
for (i=0; i<4; i++){
attachMovie("title","web"+i,10+i);
_root["web"+i]._x = 20;
_root["web"+i]._y = 20+20*i;
}
But when I open the main swf and it loads webb.swf, the movie clips of webb.swf are not displaying as I am trying to make them display.


In other words, why are not the MCs in their x and y place?

mneil
01-18-2008, 12:59 PM
You're using _root, which is wrong. Swf's have their own levels. the _root of a swf is level_0. But, if you load a swf into another swf your _root of the loaded swf is now level_1, but _root still points to level_0. Try this:

var i:Number;
for (i=0; i<4; i++){
var a:MovieClip = attachMovie("title","web"+i,10+i);
a._x = 20;
a._y = 20+20*i;
}

Ovaire d'Oz
01-18-2008, 01:25 PM
Thanks a lot for the script, it works perfect, and for the level trick.