Skip to main content
Participating Frequently
January 23, 2013
Question

Flash Buttons- "Over" option not overlapping other buttons

  • January 23, 2013
  • 1 reply
  • 1068 views

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.

This topic has been closed for replies.

1 reply

Inspiring
January 23, 2013

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.

Inspiring
January 24, 2013

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.

Js565Author
Participating Frequently
January 24, 2013

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?