function blah(){
for(var f:int = first; f<last; f++){
var hold:MovieClip = new MovieClip();
addChild(hold);
mcHolder.addChild(hold);
depthArray.push(hold);
storage[hold]= new Object();
storage[hold].id = f-first;
storage[hold].depth = depthArray;
}
mcHolder.y = 0;
mcHolder.x = 100;
addChild(mcHolder);
}
function hover_on(e:MouseEvent):void{
var a:Object = storage[e.currentTarget];
var theId:Number = a.id; //number of the button that is hovered.
var theDepth:Array= a.depth;
for(var c:int = 0; c<theDepth.length; c++){
if(mcHolder.getChildAt(theDepth.length-1) == theDepth[c]){
var highestDepth:Object = theDepth[c];
}
}
mcHolder.parent.swapChildren(theDepth[theId], highestDepth); // i guess this is the line I'm having trouble with
}
the code is stripped down for the sake of brevity. I’m just trying to show where everything is.
so “hold” is the button and is in a loop. All the buttons are placed in mcHolder.
How do I swap depths within the mcHolder?