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