FusionMaps also allows you to handle the following event types in your parent movie:

  • Loading & Rendering of Map
  • Roll over and roll out event for each entity
 
Handling rendering event of map

All the maps in FusionMaps suite expose an event rendered once they've finished rendering. You can create your listener objects to listen to this event, using the following code:

//Create a listener object to listen to the rendered event of the map
var objL:Object = new Object();
objL.rendered = function(){
   trace("The map has finished rendering");
}

//Register the object with the chart
myFirstMap.addEventListener("rendered", objL);

When you run this code with your map, you'll get notified when the map rendering process is completed.
 
Handling roll over/roll out event for entities

FusionMaps allows you to capture roll over/out events in your code whenever an entity in map has been hovered upon. This feature can be particularly useful if you want to show additional information for each entity on roll over.

To enable this, the first step is to add exposeHoverEvent='1' attribute to <map> element, as shown under:

<map ... exposeHoverEvent='1' ...>

After this, you can listen to the events using the code below:

//Create a listener object to listen to events
objL.rollOver = function(target){
   trace("Mouse was rolled over entity with id " + target.id + " | Short Name: " + target.sName + " | Long Name: " + target.lName + " | Value: " + target.value);
}
objL.rollOut = function(target){
   trace("Mouse was rolled out");
}
//Register the events
map1.addEventListener("rollOver", objL);
map1.addEventListener("rollOut", objL);

As you can see above, we've defined the rollOver and rollOut events for the map. Whenever the entities are now hovered upon, the listener object is called and the methods invoked. The target object passed to the method contains following parameters: id, sName (short name), lName (long name) and value.

In the above example, we've just traced out the entity name received as parameter. In your code, you could pass indexes of data and then deal with it the way you want to.