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

How to place button "over" graphics above all other button layers?

Community Beginner ,
Nov 29, 2022 Nov 29, 2022

Copy link to clipboard

Copied

I have multiple buttons in layers on a timeline.  Because the buttons are in separate layers, the rollover state of each button pops up behind other buttons on the map. How do you make the rollover state appear above all other inactive buttons on higher layers in the timeline?  Screenshots attached.

Views

599

Translate

Translate

Report

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 2 Correct answers

Community Expert , Nov 29, 2022 Nov 29, 2022

Hi.

 

You can add event listeners to your buttons like this:

function bringToTop(e)
{
	e.currentTarget.parent.addChild(e.currentTarget);
}

this.stop();
this.yourButton0.on("mouseover", bringToTop);
this.yourButton1.on("mouseover", bringToTop);
this.yourButton2.on("mouseover", bringToTop);
// and so on


Regards,
JC

Votes

Translate

Translate
Community Expert , Nov 30, 2022 Nov 30, 2022

Hi again.

 

No need to apologize.

 

You just need to move the lines that add the listeners from within the function body and place them in one of the lines below like in the image.

image.png

Votes

Translate

Translate
Community Expert ,
Nov 29, 2022 Nov 29, 2022

Copy link to clipboard

Copied

Hi.

 

You can add event listeners to your buttons like this:

function bringToTop(e)
{
	e.currentTarget.parent.addChild(e.currentTarget);
}

this.stop();
this.yourButton0.on("mouseover", bringToTop);
this.yourButton1.on("mouseover", bringToTop);
this.yourButton2.on("mouseover", bringToTop);
// and so on


Regards,
JC

Votes

Translate

Translate

Report

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 Beginner ,
Nov 29, 2022 Nov 29, 2022

Copy link to clipboard

Copied

I will try to figure out how to do that thank you.

Votes

Translate

Translate

Report

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 ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

You're welcome.

 

Please let us know if you need further assistance.

 

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

Apologies for my ignorance here I don't know how to assign the code to the timeline.  Here's what I have so far.  I'm sure I'm missing some code or functionality as the test still displays the popups underneath higher layers.

Votes

Translate

Translate

Report

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 ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

Hi again.

 

No need to apologize.

 

You just need to move the lines that add the listeners from within the function body and place them in one of the lines below like in the image.

image.png

Votes

Translate

Translate

Report

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 Beginner ,
Nov 30, 2022 Nov 30, 2022

Copy link to clipboard

Copied

That is amazing! IT works thank you so much!!

Votes

Translate

Translate

Report

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 ,
Dec 01, 2022 Dec 01, 2022

Copy link to clipboard

Copied

LATEST

Awesome! You're welcome!

Votes

Translate

Translate

Report

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