Controlling swapDepths with a loadMovie

I am working on a full Flash web site in MX. I am using the loadMovie method for each page of the site(each page is a seperate .swf). On one of the swfs I have two movie clips that use the swapDepth method to show contents of each. I used the tutorial on this site for that. When I load this “page” into the main movie the swapDepths will not work. I know it has to do with the _root timeline of the main movie. How can I target these clips to work from the main swf.? I am a newbie so any help will be great.:slight_smile:

you can’t use swapDepths on loaded movies because they are not on depths. you can use swapDepths on attached or duplicated movies (or createEmptyMovieClip movies) only.
loaded movies are on levels and levels can’t be swapped.
hope that helps,
jeremy

I am loading the swf into an empty movieclip. Would that make a difference?

if that movie clip was attached, duplicated or dynamically created (with createEmptyMovieClip) then it is on a depth and it’s depth can be swapped. just use the target to the container clip to set it’s depth. you can set it’s depth like this:
_root.mcContainer.swapDepths(200);
where 200 is the desired depth or depth of the movie clip that you would like to swap it with.
:slight_smile:
jeremy

*Originally posted by sinfiniti *
if that movie clip was attached, duplicated or dynamically created (with createEmptyMovieClip) then it is on a depth and it’s depth can be swapped.
I think it’s true for any clip, attached or drawn, no?

pom :q:

it is actually any object that is on the stage in the same timeline and has a depth associated with it. so, in mx it’s pretty much everything but a graphic. the only problem with movie clips that are on the stage and not associated with a depth number is that you don’t really know it’s stacking order because it is defined by timeline, then layer, then the order that it was placed on the stage. and, since there is no need to create a ‘seed’ clip anymore, it is much easier to just create movie clip instances on the fly when they are needed - and when you do that you know the depths that you will be using.
have a nice day,
jeremy