Flash Buttons- "Over" option not overlapping other buttons
Copy link to clipboard
Copied
Hi,
How do you make the "over" for buttons universally appear on top? When I made 4 flash buttons side by side, i am wanting to make it so that when you hover over one of the buttons a rectangle expands to show a description of that button- this rectangle should be large enough to cover over the other three buttons but for some reason the other buttons are still visible over the rectangle. I have made it so the top button layer is at the top and then the 2nd button underneath that so on...however when i hover over the 2nd button, the rectangle description box doesn't cover over the first button. How would I be able to make it so that the "over" rectangles are always covering all three other buttons?
as you can see below, this is when i hover over the second button, the rectangle isnt able to cover the first button.
Please is there a solution to this? I am wanting it to work very much like when you hover over icons similar to rollover for websites.
I appreciate anyone that can help.
Copy link to clipboard
Copied
AS3 handles depths far better than AS2 to you might want to consider migrating.
Use the swapDepths() function to change the depth of movieclips, it probably won't work with buttons so you may have to convert them all to movieclips and create the up, over, out and down frames manually.
'Over' for buttons doesn't mean over other movieclips, it means your mouse is over the button.
Copy link to clipboard
Copied
Yes for some reason in AS2 you can't use swapDepths() directly with Buttons—however most of us don't use buttons because they are so twitchy and weird.
If you do want to use real buttons and you do want to swap their depths you can use this code:
Button.prototype.swapDepths = MovieClip.prototype.swapDepths;
You just need that once at the beginning of your code. It tells Flash that Buttons know what MovieClips know about swaping depths. I've used it in a few tests, but in general I don't use buttons. Instead I use MovieClips.
Copy link to clipboard
Copied
I tried this by putting it in my code but it didn't make the button stay under the expanding rectangle.
am i putting this code in the wrong place? putting it on a keyframe at the start of the timeline?
Copy link to clipboard
Copied
Yes that is the place to put it, but that code doesn't do anything that you would see, by itself.
But now you can use swapDepths() with buttons to change their stacking order. Google search for a tutorial on using swapDepths. The tute my say that you have to use MovieClips, but with that code included the swapDepth method will work with your buttons.
![](/skins/images/F05736DC39F4E9CD27A7C9535F10667B/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/F05736DC39F4E9CD27A7C9535F10667B/responsive_peak/images/icon_anonymous_message.png)