If layer confusion

Ok I have 2 movies loading on 2 different levels…

player wich loads on level201 and hover with loads on level200

I’d like the bottom one (level200) to see if it’s on level200 when clicked and then swap with level201.

So I thought an if statement would work nicely… but I’m missing something… or I’ve confused myself (wich has my vote)

[AS]
if (_root.hover.getDepth() == _level200) {
_level200.swapDepths(_level201);
}

[/AS]

and visa versa

[AS]
if (_root.player.getDepth() == _level200) {
_level200.swapDepths(_level201);
}
[/AS]

What am I missing?

your missing the
[AS]on (release) {
blah blah
}[/AS]
part as far as i can tell

Heh no that’s there…

instead of doing the _level#.swapDepths(_level#+1)

can you just do

player.swapDepths(hover);

Seems to work for me. I have never seen the swapDepths done with the level, just the movie name

well the 2 movie clips are being loaded into 2 different levels so calling them by their instance names wount work, and by level is the only way to call them.

That’s why I’m using getdepth to determine their depth first then is that info is correct swap

Ok, but I don’t know how you’re going to swap a level. Because there is no function for it. The swapDepths() function is for a movie clip instance name and another movie clip instance name. You’ll have to do something like:

[AS]
if (_root.hover.getDepth() == _level200) {
_level200.hover.swapDepths(_level201.player);
}

if (_root.player.getDepth() == _level200) {
_level200.player.swapDepths(_level201.hover);
}

[/AS]

I am a little confused though, because you are calling hover and player from _root, meaning that they should both be able to swap depths. I would recommend trying it without the _levels. Also, do you know if getDepth() returns a _level# or does it just return a number? because if that condition is never true, it will never do that stuff.

All I’m tyring to get it to do is test and see what level it’s on and if it’s on one level then swap its self with another level once clicked on…

The reason I’m isuing _root is well… the code is inside popup.swf that has a mc called hover. So I’m using _root.hover to give it an absolute path.