|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
advanced swapdepths problem
hi, i have a little problem witht the mcA.swapDepths(mcB) function.
i have a movie where users can add objects in the movie. when the mouse goes over on of those objects, it expands and has to be drawn above the other objects. i load all the objects from an xmlfile. the loading and stuff goes fine, so i wont pay attention to that here. i have a dummyObject, which is a movieclip. i create a copy of this dummy for each object in my xmlfile. this goes a little like this (simplified version): var topId; function drawObjects() { for (i=0; i<numberOfObjects; i++) { // as u can see, each object is copied in its own depth duplicateMovieClip (dummyObject, "object" + i, i); topId = i; // the last object has to be on top when drawn } } in the object i have a rollOver call to the function fixDepth(movieClip, id) this is how fixDepth(movieClip, id) looks like: function fixDepth(movieClip, id) { var topMovieClip = eval("object" + topId); topMovieClip.swapDepths(movieClip); topId = id; } this function should swap the incoming movieClip with the topMovieClip and therefore should allways be drawn above ALL the other objects. the movieClip is now on top and this is 'remembered' by setting the topId to id. now here's the problem: this doesn't allways draw my object above all the other. what did i do wrong? since i can't trace the depth of an object, debugging is quite difficult. is there a maximum number of depths available? thnx in advance koala |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > advanced swapdepths problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|