Child Index


I have this swf file

This will eventually be loads of these pins. I’m using the Pin head as a hit area to start the simple rollover animation.

I just want the the grey box that appears to allows be on top of all the pins. I’ve managed to get it to do this but then once I have it on top the other pins event handler doesn’t work.

Is there a way of storing the current index in a variable so I can return the movieclip to this on the rollout function?

Or is there a better way altogether? whilst keeping things simple?

My code so far

//Roll over and out button actions
var buttonArray:Array =

function initSite():void
	for (var i:Number = 0; i < buttonArray.length; i++)
		MovieClip(buttonArray*).addEventListener(MouseEvent.ROLL_OVER, onOver, false, 0, true);
		MovieClip(buttonArray*).addEventListener(MouseEvent.ROLL_OUT, onOut, false, 0, true);

function onOver (event:MouseEvent):void
	this.setChildIndex(this.getChildByName(, this.numChildren-1);

function onOut (event:MouseEvent):void