hi, im having a little trouble with the maps api, im trying to make is so that the map reads addresses from an xml file and updates it on the map
this is the actionscript i have:
import com.yahoo.maps.markers.CustomPOIMarker;
import com.yahoo.maps.tools.PanTool;
import com.yahoo.maps.widgets.NavigatorWidget;
import com.yahoo.maps.widgets.SatelliteControlWidget;
var x:XML = new XML();
x.ignoreWhite = true;
var addresses:Array = new Array();
var headers:Array = new Array();
var captions:Array = new Array();
var infos:Array = new Array();
var whoIsOn:Number;
myMap.addEventListener(com.yahoo.maps.api.flash.YahooMap.EVENT_INITIALIZE, onInitMap);
function onInitMap(eventData) {
var navWidget = new NavigatorWidget("closed");
myMap.addWidget(navWidget);
myMap.addWidget(new SatelliteControlWidget());
var panTool = new PanTool();
myMap.addTool(panTool, true);
x.onLoad = function() {
var photos:Array = this.firstChild.childNodes;
for(i=0;i<photos.length;i++){
addresses.push(photos*.attributes.address);
headers.push(photos*.attributes.header);
captions.push(photos*.attributes.caption);
infos.push(photos*.attributes.info);
}
var mainLocation = addresses[j];
myMap.setCenterByAddress(mainLocation, 0);
myMarkerData = {index:headers[j], title:captions[j], description:infos[j], markerColor:0x990099, strokeColor:0xFFFF00};
}
}
x.load("test.xml");
and this is the XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>
<photo address="1688 E Oakland Park Blvd, Fort Lauderdale, FL 33334" header="Sale" caption="3000SqFt 3/3" info="For more info please call: xxx.xxx.xxxx" />
<photo address="4015 West Palm Aire Dr., Pompano Beach, FL 33069" header="Sale" caption="2600SqFt 2/3" info="For more info please call: xxx.xxx.xxxx" />
<photo address="3250 W Commercial Blvd., Fort Lauderdale, FL 33309" header="Sale" caption="1500SqFt 3/3" info="For more info please call: xxx.xxx.xxxx" />
</slideshow>
any help will be greatly appreciated
Thank You