1 person found this helpful
The quickest way is to have an image, saves getting into the drawing of graphics etc.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
protected function clickHandler(event:MouseEvent):void
<mx:Image id="hitDot" x="370" y="263" width="12" height="12" toolTip="hi there" click="clickHandler(event)" source="red.jpg"/>
you can also add or remove the image as you see fit(or just move it off the stage if you don't want to see it), to change its position just set the x and y properties
hotDot.x = width*0.75-6;
the minus 6 indicates half the hieght/width of the image to'center' it on the exact co-ordinate.
Thank you so much.
Infact, because I could not find a ready control, this is my last resort in an attempt to create a sort of interactive map that is able to show icons at specified lon/lat positions.
I found a Word Map and I managed to draw it as image.
So after using your code, only remains to intercept the WordMap image move events and update all dots accordingly right ?
Thank you again.
If the dots relate to cordinates on the map i.e if the map is extended past the display co ordinates you can just place the "dots" in the correct place, for example if you have a map of the world and paris equates to x=50 and y = 300 in the image you set the "dots" as children of the map container when the map is "panned" the dots are always correctly located. I say this on the assumption you are using some sort of panning (viewport) for the map.
Just to clarify say you have a container that its pixels relate to lat and long the dots can be placed by using the conversion of lat/long to pixels.
when the container moves or is scaled the dots remain in the correct place (the container has a world map as background and dots in the foreground)