Copy link to clipboard
Copied
I am using button symbols to create pop ups on rollover (by sticking the pop up box in their rollover state)
However I need a way to bring the buttons to the front when I rollover them because the pop up overlap the other buttons.
Irealise this question has been asked before but I’m very new to as3 and I’m having difficulty adapting the answers to my code.
I greatly appreciate any help
Ben
var buttons:Array = [btn1,btn2];
function moveFront(event:MouseEvent):void {
// move to front code
}
for(var i:uint = 0; i<buttons.length; i++) {
buttons.addEventListener(MouseEvent.ROLL_OVER, moveFront);
}
:
var buttons:Array = [btn1,btn2];
function moveFront(event:MouseEvent):void {
event.currentTarget.parent.addChild(event.currentTarget);
}
for(var i:uint = 0; i<buttons.length; i++) {
buttons.addEventListener(MouseEvent.ROLL_OVER, moveFront);
}
Copy link to clipboard
Copied
:
var buttons:Array = [btn1,btn2];
function moveFront(event:MouseEvent):void {
event.currentTarget.parent.addChild(event.currentTarget);
}
for(var i:uint = 0; i<buttons.length; i++) {
buttons.addEventListener(MouseEvent.ROLL_OVER, moveFront);
}
Copy link to clipboard
Copied
Thank you!
I was trying
this.parent.addChild(this);
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now