I have never worked on action script. need help with listener. I am calling and event DrawManager.ZOOM_TO_SELECTION but need to wait for this event to finish before I call the next function "saveMapImage". Can anyone tell me how to do that with a code example?
public function saveMapImageAndForward(projectLocationWKT:String, projectMapType:String, hasMapImageFromIPaCMap:String, projectName:String):void {
this.projectLocationWKT = projectLocationWKT;
this.projectMapType = projectMapType;
this.hasMapImageFromIPaCMap = hasMapImageFromIPaCMap;
this.projectName = projectName;
//GlobalDispatcher.dispatchEvent(new Event(Event.COMPLETE));
GlobalDispatcher.dispatchEvent(new AppEvent(DrawManager.ZOOM_TO_SELECTION));
//GlobalDispatcher.removeEventListener
saveMapImage();
}
Thanks in advance.