PDA

View Full Version : Change button hit area after rollover


HeadlessMonster
05-15-2009, 03:09 PM
Hi there,

So I have a button, and the hit area is a 10px circle. Upon rollover, a dialog balloon pops out from the circle. But when you mouse away from the circle, the balloon disappears.

I would like to change the hit area after rollover to the size of the balloon, but I have been unsuccessful. Maybe I need to make the button a movie clip and add the proper AS?

If anyone can give me some tips or can point me to a nice tutorial, that'd be awesome.

Regards,
HM

cjx3711
05-20-2009, 04:47 AM
You probably shouldn't use a button. Use a movieclip instead.

mc_name.onRollOver = function():Void {
mc_name.gotoAndPlay(2);
}

Not sure if my syntax is correct but just try it.

kkbbcute
05-26-2009, 12:16 PM
Or if you wanted it in AS3, it would be,
this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler)
function mouseDownHandler(event:MouseEvent):void {
//Some stuff
}

HeadlessMonster
05-28-2009, 02:23 PM
Thanks kkbbcute, and cjx3711...

but i still cannot get it :mad:

i sort a understand, but i couldn't get the mc to act as a button.

i attached the .fla file (cs3)...

any further insight would be awesome!

a galaxy of thanks,
hm.

kkbbcute
05-31-2009, 06:22 AM
The code (pio.onRollOver, etc...) should be on the frame, not on the mc ;)

HeadlessMonster
06-02-2009, 06:41 PM
by george that worked! thanks!!!

now i gotta figure out how to get the call-out to disappear upon rollout...:confused:

kkbbcute
06-04-2009, 05:54 AM
Just use onRollOut instead of onRollOver. ;)

Create a new function for that, like you did for the rollOver.