Answered
Button hover bring to front
- March 20, 2023
- 2 replies
- 1438 views
Have been searching for ages but cant find a working solution.
I have 5 buttons, the hover states of the buttons are bigger than the original so when rolled over they the other buttons overlap the hover state. (See jpg.) I want to bring the button that is being hovered over to the front.
This is the code I have been trying but doesnt work...
this.bringToFront = function(e)
{
e.currentTarget.parent.addChild(e.currentTarget);
};
this.button_1.on("mouseover", this.bringToFront);
this.button_2.on("mouseover", this.bringToFront);
this.button_3.on("mouseover", this.bringToFront);
this.button_4.on("mouseover", this.bringToFront);
this.button_5.on("mouseover", this.bringToFront);
