SwapChildren Glicht
- September 5, 2009
- 6 replies
- 1241 views
Hi there!.
Well i have something that a just can make it works... it's about the z-index of children object in a movie clip. When i click on a item (movie clip) i want to "zoom it" (just sclaing by 2.0 the width and height) and to show above others items that are nears.. The thing is when i move the items, the are like duplicated.. i don't why, but copies of the movie clips remains there....
I put here the important parts... the problems are in the methods sendToFront and sentToBack... basically the function swapChildren has this glicht or i am doing (most probably) something bad.
function setToFront (object:MovieClip) : void
{
removeEventListener(MouseEvent.CLICK,btnLinkClickHide);
var prevMc:MovieClip = (this.getChildAt (3) as MovieClip);
swapChildren(prevMc,object);
}function setToBack (object:MovieClip) : void
{
addEventListener(MouseEvent.CLICK,btnLinkClickHide);
var prevMc:MovieClip = (this.getChildAt (3) as MovieClip);
swapChildren(object,prevMc);
}
setToFront is exectued from a callback from the movieclip that is seleting the user. And setToBack is executed from a Timer when finalizes (i am using intervals, not real Timers classes) restoring the moviecliup the normal size. See the .swf for help!
Thanks for advance if you reach this point!!
.
See ya!