PDA

View Full Version : rollover child component problem


cybohemia
12-18-2008, 03:53 AM
Hi.

I'm trying to make a standard hint box: some text pops up when the user mouses over a rectangular box.

I made two AS3 Sprite subclasses: Thing and Hint. When the user rolls over the Thing the Hint should pop above it.

Well, the Hint does show up but it seems that it messes up the right-end boundary where the rollover and rollout events happen. Although both Thing and Hint are 20 pixels wide, the rollover and rollout events happen at x=0 and x=100. (For Thing without the Hint child node, the rollover and rollout events happen at x=0 and x=20, as expected.)

I've tried changing from ROLL_OVER to MOUSE_OVER and setting MouseEnabled=false in Hint (as well as MouseChildren=false in Thing) but to no avail.

I guess I'm confused about the event propagation model. That, and how to set the boundaries of the sprite, as well.

Any help, advice or ideas would be greatly appreciated!

Thanks,
cybohemia