This content has been marked as final.
Show 3 replies
-
1. Re: Drag and Drop on top of each other
kglad Nov 15, 2007 12:45 PM (in response to YTCollege)oops, don't use this.getNextHighestDepth(). use this._parent.getNextHighestDepth(), if all your objects have the same _parent movieclip. -
2. Re: Drag and Drop on top of each other
YTCollege Nov 15, 2007 1:24 PM (in response to kglad)Thanks for writing back. I tried your advice and it still does the same thing. All of my objects are separate movie clips but they are all on the same layer on the root level. I tried to put each object on separate layers but it still did the same. It seems that I read before that it depends on the order that you import the pictures as to what depth the pictures will be. Has anyone ever heard this? I have no other code in my project. The code that is posted above is copied 25 times and the names of the movie clips are changed. -
3. Re: Drag and Drop on top of each other
Avix_Turch Nov 15, 2007 1:51 PM (in response to YTCollege)getNextHighestDepth() doesn't work unless you are attaching a movieClip. The best way i know how to do this is to set up a variable on your main timeline such as:
var currentDepth:Number = 200;
Then in your code when they drop the item, place this code:
this.swapDepths(curentDepth+1);
this will make whatever item you drop be on top at all times. Now if you want items to go beneath others or on top of others in a certain way no matter how they drop it, I would suggest defining each items depth.
(if item A's instance name is "itemA" and so on)
var item_A_Var:Number = 5;
itemA.swapDepths(item_A_Var);
itemB.swapDepths(item_A_Var - 1);
this will make Item B go under Item A.


