Advanced Flash Components
Search!
Search!
Home >  Knowledge Base >  Map >  Using map events to display a...
Using map events to display a custom tooltip
Date: Jun 25, 2007   Views: 1304  
Question:
I have Tooltip V 3.5 and MAP V. 3. Is it possible to use them together. I have custom map. I would appreciate your response.
Answer:

wigz (Admin)
Add the map and the tooltip to the stage.  Make sure the displayTooltip property for your Map is set to false.  Make sure autodrag is true and autoshow is false for your Tooltip.

Then you just need to use the following code on the timeline in it's own layer in the same frame as your map and tooltip.

function over(evnt:Object) {
   myTooltip.content = evnt.locationDescription;
   myTooltip.showTooltip();
}

function out(evnt:Object) {
   myTooltip.hideTooltip();
}

myMap.addEventListener("over", this);
myMap.addEventListener("out", this);

Thanks!
Component Info
Map