In order for me to send a variable along with the click I add the
following to my eventListener:
aMarker.addEventListener(MapMouseEvent.CLICK, function
(event:MapMouseEvent):void {markerClicked(event, idString,
typeString);});
}
Here's my listener event:
private function markerClicked(event:MapMouseEvent, id:String,
typeString:String):void {
dispatchEvent(new CustomEvent (CustomEvent.ON_CLICK, id,
typeString));
}
Here's the custom class code I use:
package com.Events
{
import flash.events.*;
public class CustomEvent extends Event
{
public static const ON_CLICK:String = "onClick";
public var _id:String;
public var _type:String;
public function CustomEvent (type:String, idString:String,
typeString:String, bubbles:Boolean=false, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
_id = idString;
_type = typeString;
}
public override function clone():Event
{
return new CustomEvent (type, _id, _type,
bubbles,cancelable);
}
}
}
If you need any more code, please let me know.
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.