PDA

Volledige versie bekijken : Depth checken?


joepbjj
%Europe/Berlin %752 %2006, 18:03
Hallo iedereen,

Is er een mogelijkheid om het actionscript de depht van een mc te checken?

Dus zegmaar zoiets:

if (mc_1._currentdepth == 1){
mc_1.swapDepths(mc_2);
}

Alleen dan iets wat werkt. :P

Groet Joep.

BernardV
%Europe/Berlin %756 %2006, 18:09
if(mc_1.getDepth() == 1)
werkt wel denk ik...

Erwinzzz
%Europe/Berlin %759 %2006, 18:13
depth kan je opvragen door

instancename.getDepth()

te gebruiken en

instancename.swapDepths()

zoals jij al aangaf om een depth te zetten.
In dit voorbeeld heb ik 2 overlappende mc's die als je op je op ze drukt naar voren komen, maar niet gebruik maken van getNextHighestDepht();

mc1.onRelease = function() {
if (this.getDepth()<mc2.getDepth()) {
this.swapDepths(mc2);
}
};
mc2.onRelease = function() {
if (this.getDepth()<mc1.getDepth()) {
this.swapDepths(mc1);
}
};

Pointer
%Europe/Berlin %792 %2006, 19:01
Alle depths opvragen doe je zo:

for (var i in this) {
if (typeof (this[i]) == "movieclip") {
trace("movie clip '"+this[i]._name+"' is at depth "+this[i].getDepth());
}
}