To be precise, mx:Image can be a mouseTarget as it is a UIComponent
wrapping the images.

 

Embedded images generally are not as are any other bitmaps loaded
through flash.display.Loader.

 

It depends on how you set things up.  However, placing transparent hit
areas is a good way to divide up areas of a renderer into separate
targets.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of tsiesser
Sent: Saturday, June 02, 2007 9:32 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Context menu mouseTarget vs. itemRenderer with
Image control

 

Wow - images are not mouse targets. Okay, that's going to be
challenging - because I was actually planning on some special actions
to occur when the user clicked on the corners of the image. So maybe
the transparent sprite will be the key? I'll try it...

Thanks!

--Tracey

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Images are not mouse targets. Try setting mouseChildren=true and/or
> mouseEnabled=true in the renderer. You may also need to cover the
image
> with a Sprite with alpha=0
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of tsiesser
> Sent: Friday, June 01, 2007 4:59 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Context menu mouseTarget vs. itemRenderer with
> Image control
> 
> 
> 
> I'm hoping someone's had experience with this one... I have a TileList
> control with a custom itemRenderer. The renderer consists of an Image
> control and a few Label controls. 
> 
> I've also attached a custom context menu to the TileList. In the
> MENU_SELECT event, I want to set the TileList's selectedItem to the
> item that the mouse is over before popping up the context menu. So I
> examine the event.mouseTarget property... this might be one of the
> embedded Label controls, so I crawl up the parent property till I get
> to the top. Works great - I eventually get to the itemRenderer level,
> where I can check if the renderer.data value is already selected, and
> if not, select it.
> 
> It *doesn't* work if I right-click on the Image control. In that case,
> mouseTarget comes back as a MovieClip object with its parent property
> set to null - there doesn't seem to be any way to determine which
> itemRenderer it belongs to!
> 
> Any ideas? All help appreciated, as always!!!
> 
> --Tracey
>

 

Reply via email to