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.
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
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.
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
Copy link to clipboard
Copied
I will try to figure out how to do that thank you.
Copy link to clipboard
Copied
You're welcome.
Please let us know if you need further assistance.
Regards,
JC
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
That is amazing! IT works thank you so much!!
Copy link to clipboard
Copied
Awesome! You're welcome!