views:

13

answers:

1

I'm creating a container as a MovieClip and adding a mousewheel handler, then adding items to it like so:

container = new MovieClip();        
addChild( container );
container.addEventListener( MouseEvent.MOUSE_WHEEL, HandleWheel );
container.addChild( item );
// etc. adding more items 

However the mousewheel is only responding when the mouse is over one of the items, not over the visible areas of the container between the items. Is there any way to make it so the event is always triggered when the mouse is over the container, not just over its children?

I don't know if it's relevant, but the container has a mask set. I tried adding the listener to the mask and it didn't do anything, though.

If I set the opaqueBackground of the container to red, I can see the container bounds. I don't understand why the mouse wheel event isn't triggering when the mouse is within these bounds. If this is really not possible, is there another way to handle the situation without needing the container to respond directly to mouse events?

Thanks for any help.

A: 

You may need to add a rectangle to the background to act like a bounding box. It can have its alpha set to 0%. The problem is that if the cursor is on a completely transparent area of the object, it will just not pass mouse events to it, as it shouldn't (otherwise we'd always be stuck with rectangular areas); in that case, adding the transparent backgrounds fixes it.

zeh