How to add a MapMouseEvent?

381
2
Jump to solution
06-27-2012 05:32 AM
ShaningYu
Frequent Contributor
I want to add a MapMouseEvent in ActionScript.  The code I created is below:
  map.addEventListener(MouseEvent.CLICK, myEventHandler);
  ......
  private function myEventHandler(e:MapMouseEvent):void {  ... }
But I received TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::MouseEvent to com.esri.ags.events.MapMouseEvent.
How can this bug be fixed?  Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
Instead of adding the MouseEvent.Click event, you should add the MapMouseEvent.MAP_CLICK event

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
Instead of adding the MouseEvent.Click event, you should add the MapMouseEvent.MAP_CLICK event
0 Kudos
ShaningYu
Frequent Contributor
Thanks.  It works.
0 Kudos