PDA

View Full Version : changing "hit" during "over"


General Tso
08-11-2009, 02:26 AM
My buttons have movieClips in the "over" state that reveal other options, which are movieClips themselves. The problem is that when I roll away from the original button (to try to get to the new options), the original button goes back to it's "Up" state. I can't create a larger hit area because I want the original shape to be the only hit area, until I roll over of course. Let me know if I'm not being clear.

How do I create a new hit area only for the over state?

I have a bunch of them so I'd rather not recreate the buttons as movieClips themselves (with AS of course), unless that's really the only way.

BronL
08-11-2009, 05:33 AM
I hate to be the one to break it to you, but you're going to have to convert your buttons to mcs. At least you don't lose the art when you convert them, but you will have to write your onRollOver/onRollOut functions.

I personally never use buttons - 99% of the time I find I (or the client) want to do more with them than I'd anticipated.

General Tso
08-12-2009, 01:06 AM
Thanks for the response. I figured that would be the answer. I began converting one of them to a movieClip and writing the AS3. But I can't get it to work quite right.

I have a square that expands into other options with a MOUSE_OVER. This works no problem. I drew an invisible rectangle underneath all of these options so that they would stay open when I moved the mouse towards them.

But when I try to code the first button (also a movieClip) to work with MOUSE_OVERs and CLICKs it causes problems. At first when I tested the movie it looked fine until I tried to MOUSE_OVER the first new option. The new option produced no results. I think this was because the original invisible rectangle was on top of it.

So I changed the order of layers so the invisible rectangle was on bottom. Then as soon as I tried the new option, the entire original movieClip collapsed back to its original state. I assume that the area beneath the new option was being covered up, and thus my MOUSE_OVER no longer registered (on the original movieClip).

I then tried adding code to tell the original movieClip to also listen for a MOUSE_OVER on the new option. This worked - I could move the mouse over the new option and the original movieClip remained open, but the old problem of the new option not registerring occurred. I think my new code overrided what I wanted the new option to do.

I am confident that I could probably get this all to work if I simply opened the original movieClip with a CLICK instead of a MOUSE_OVER, but I'd rather keep using a MOUSE_OVER if there's a way to do it.

I realize that this is all a bit hard to follow, so to summarize - I want a single movieClip to animate, revealing new movieClips. I want to be able to animate these new movieClips (with MOUSE_OVERs and CLICKs), all while the original movieClip remains "open" in its MOUSE_OVER state/frame.

BronL
08-12-2009, 01:09 AM
Sorry - I'm not yet confident enough with AS3 to help you further.

Aberrant
08-12-2009, 07:23 AM
General Tso

Please upload a sample button to megaupload or rapidshare showing what you want.

Cheers.