Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

bring button (and pop up) to front on roll over

New Here ,
Aug 01, 2013 Aug 01, 2013

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);

}

TOPICS
ActionScript
675
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 01, 2013 Aug 01, 2013

:

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);

}

Translate
Community Expert ,
Aug 01, 2013 Aug 01, 2013

:

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);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2013 Aug 01, 2013

Thank you!

I was trying

this.parent.addChild(this);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2013 Aug 01, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines