PDA

View Full Version : Simulating a mouse-under?


charlesshoults
06-10-2009, 01:37 AM
Lets say you have the following component:
http://battletechlive.files.wordpress.com/2009/06/picture-1.png
In order to get the playlist to look correct, an image is in the very back, with a dataGrid over it, and finally the overlay image on top of the dataGrid. The problem now is that the dataGrid is inaccessible to the mouse, so tracks can't be changed except by clicking the previous and next buttons in the small player above. So, how do you make it work? I can capture the mouseX and mouseY position as it relates to the overlay, but can that be translated into directions for selecting the dataGrid beneath, including being able to scroll up and down through the list? It would be truly convenient if the overlay image could be made transparent to the mouse so that the dataGrid has focus instead of the overlay.

aktell
06-10-2009, 07:58 AM
Hi there,

I’m not sure if this will help you but I’m working at the moment with something similar and I use a module and of course the Application. My Image is located in the app. itself and the component in a module I select anything in my module/component very easily still having the Image showing on top of the whole app. And I have adapted a menu which only is showing fading In/Out and can be selected when your mouse is over the main area app. module area otherwise not visible at all.

regards aktell

Peter Cowling
06-10-2009, 12:07 PM
I would recommend checking out blends. You can blend a lower z-index image into the other i.e. the blend effect can be based on some image behind the datagrid. (You can also do AS work if you do not want to use an image.)

A good place to get a feel for how these work is this article (http://www.insideria.com/2008/02/flex-graphics-tricks-part-2-bl.html).

wvxvw
06-10-2009, 12:13 PM
Well, first thing the image shouldn't really prevent click events from getting into the datagrid unless it has added listeners to those events itself and stopped propagation or something like that...

charlesshoults
06-10-2009, 05:22 PM
I tried a number of things, from making the overlay an image that sits over the dataGrid, using canvas as a container with the overlay as it's background, and tried using blend modes to get it to combine with the base image that sits behind the dataGrid, but none of them worked. In the end, I decided not to mess with it. I adjusted the image that's used behind everything and got rid of the overlay, making fewer elements on screen.

To my eye, this layout looks fine. The frame is glossy and reflects while the LCD is matte and does not. The icons along the left side have a 0.1 alpha and increase to a 0.5 with a mouse_over.

http://battletechlive.files.wordpress.com/2009/06/picture-2.png

Robbus
06-19-2009, 04:37 PM
Bit late in the day but in case it helps anyone else, you need to be looking at movieclip.mouseEnabled. Set the highlight movieclips mouseEnabled to false and it should pass the events straight through.

Cheers,
Rob