Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 11
Registered: ‎04-01-2008
My Device: Not Specified

Mouse begin/move/end events only get reported from margins of Container, not in free space

[ Edited ]

Is there a way to get a specific container to report mouse begin/move/end events rather than the whole screen?  I've noticed that if I add event listeners to a container, only when the mouse moves within the margin area do events actually get reported. 

 

So in psuedocode:

 

new container1 with thick margins (20,20,20,20)

new container2 with thick margins (20,20,20,20)

container1.addChild(container2)

addChild(container1)

 

container2.addEventListener(MouseEvent.MOUSE_MOVE,callback)

 

If I do this instead

 

container2.stage.addEventListener(...)

 

Then mouse events are reported on the whole screen.  But that's not what I want.  I only want to capture events within a specific container.  It seems the events are reported opposite to what I expect.  It's reporting movement on the margins rather than the empty space in between.

 

I attached an image to demonstrate what I mean....

 

example.jpg

 

 

Any idea why the container does this?

 

I'd also like to put images inside the empty space but still have mouse movements reported.

 

Thanks

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Mouse begin/move/end events only get reported from margins of Container, not in free space

QNX Container is not an event dispatcher.  You need to add an element that is able to dispatch events.  In MX framework, practically everything could dispatch events.  In QNX, that is not the case.