views:

41

answers:

1

Hello stackOverFlower,

Does anybody know how to programmatically enlarge a flex 3 button's hitArea. Is there some function that i can override? There is no function in the button class called hitArea.

WHat i have done is, i have created a programmaticskin for a button. The form of the skin consists out four arrows. In between the arrows there is nothing (meaning transparant). Because of the way the skin is shaped, it's difficult to click on the button. The skin has alter the buttons hitArea. What i'm looking for is a way to enlarge the hitArea and alter the hitArea shape in to an square. (the hit area must ofcourse still be invisble).

Does anybody know how to accomplish this?

Thanks

DJ

+2  A: 

The way I've handled this in the past is to fill the rect with a nearly invisible fill by setting the alpha to 0.001 (or something similar). That way the button thinks the area is drawn and therefore hittable, but it's too transparent for the user to see. It's cute/hackish, but it works. :)

Wade Mueller
Thank you, that was helpfull
DJ
Quick note: even fully transparent fills (i.e. alpha 0) are interactive and will give the same affect.
Sly_cardinal
Interesting, did not know that. Thanks!
Wade Mueller