Hey Mel,
Take a look at the DepthManager. You can use it for exactly what you
are trying to do. The catch is that you have to instantiate the
MovieClips you want to use via actionscript with the DepthManager
functions. Remember to do this because the DepthManager needs to
keep track of all elements you want to sort. Then all you have to do
is use the constants DepthManage.kTop, DepthManage.kBottom, etc. The
manager sorts its children instances using these constants by putting
each call to kTop in depth 201 and then moving the rest down
sequentially (actually vice versa).
Hope this helps,
_S
Hello,
I have another question for the group:
I was using this...
for (var i in this) {
if (typeof (this[i]) == "movieclip") {
trace("movie clip '"+this[i]._name+"' is at depth
"+this[i].getDepth()*-1);
}
}
...to discover the depth of the movieclips I have on the stage.
Then I wrote this...
postcard_amt = [1, 2, 3];
for (i=0; i<postcard_amt.length; i++) {
postcard_itm = "postcard"+i+"_mc";
_root[postcard_itm].onPress = function(){
trace(this.getDepth());
}
}
...to specifially single out the _mc's I wanted.
Not sure if that is the best way to write it, but that's not my
question
(althought I am open to more efficient ways).
/*************
My question:
What is the best approach to finding the highest depth, the middle
depth and
the lowest depth?
*************/
Backstory:
Ideally, what I will be doing is swapDepths() with these _mc's and
reshuffling them accordingly.
if original state is...
1
2
3
...onEvent...
2
3
1
...then another Event...
3
1
2
...and so on.
Thanks for the advice,
fm
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com