Check the archives.  I think you have to set some
mouseEnabled/mouseChildren flag.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Guillermo Villasana
Sent: Tuesday, June 24, 2008 8:35 AM
To: [email protected]
Subject: [flexcoders] Problem with click event and Image component

 

Hello guys, I am having problems adding a click event to an image, I 
don't know why it just doesn't work.

I have an app something like this
<mx:Application ...>
<mycomponent:myCanvas/>
</mx:Application>

in myCanvas component I have
<mx:Canvas ...>
<mx:Script>
<![CDATA[
...
import flash.events.MouseEvent;

public function myClickEvent(event:MouseEvent):void
{
do some stuff
}

public function initApp():void
{
do some stuff
img2.addEventListener(MouseEvent.CLICK,myClickEvent,false,0,true);
}
]]>
</mx:Script>
<mx:Canvas ...>
other components
<mx:Image id='img2'/>
</mx:Canvas>
</mx:Canvas>

I don't know why the img2 doesn't do the click event
any thoughts
Thanks

 

Reply via email to