Hi Leo...
Thanks for your help. I have modified my code. Now its more like yours,
but now i get the following errors??


1120: Access of undefined property propertyList. var lat:Number =
propertyList.lat;

1120: Access of undefined property propertyList. var lng:Number =
propertyList.lng;

1120: Access of undefined property propertyList. var
MyDescription:String = propertyList.MyDescription;

1120: Access of undefined property propertyList. var myTitle:String =
propertyList.myTitle;

1120: Access of undefined property propertyList. var website:String =
propertyList.website;

1120: Access of undefined property propertyList.var street:String =
propertyList.street;

1120: Access of undefined property iterationMarker.
map.addOverlay(iterationMarker);

1120: Access of undefined property propertyList. for (i = 0; i <
propertyList.length(); i++){

1120: Access of undefined property markerLatLng. var
iterationMarker:Marker = new Marker(markerLatLng, markerOptions);



Could it has something to do with that the code is running through
before the XML is loadéd?


Morten






import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.google.maps.controls.ZoomControl;
import com.google.maps.controls.PositionControl;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.overlays.Marker;
import com.google.maps.InfoWindowOptions;
import com.google.maps.MapMouseEvent;
import flash.text.TextFormat;


var map:Map = new Map();
map.key
= 
"ABQIAAAAF5GHwa7hgxz5etSP-jJVwhSK_rP-_Usta8fEpiVtC50gLzF69hQ6_VK0zgpArekpmdsRCJK2Vnp60A";
map.sensor = "false";
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
map.x = 0;
map.y = 200;
map.addEventListener(MapEvent.MAP_READY, SetUpLoadXML);
this.addChild(map);


function SetUpLoadXML (event:MapEvent):void {
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, processXML);
xmlLoader.load(new URLRequest("data/data.xml"));
}


function processXML(event:Event):void {
try{
var xmlData = new XML(event.target.data);
parseData(xmlData);
} catch (event:Error) {
trace("Error Parcing XML:" +event.message);
}
}

function parseData(xmlData):void {
var i:int;
var dataList:XMLList = xmlData.rootXMLNode;
for (i = 0; i < propertyList.length(); i++){
var lat:Number = propertyList.lat;
var lng:Number = propertyList.lng;
var MyDescription:String = propertyList.MyDescription;
var myTitle:String = propertyList.myTitle;
var website:String = propertyList.website;
var street:String = propertyList.street;
trace(street[0]);
trace(website[0]);
trace(MyDescription[0]);
trace(myTitle[1]);
trace(lng[1]);
trace(lat[1]);
var markerLatitude:Number = dataList[i].lat;
var markerLongitude:Number = dataList[i].lng;
var Latlng:LatLng = new LatLng(dataList[i].lat,dataList[i].lng);
var markerOptions = new MarkerOptions();
with (markerOptions){
clickable = true;
draggable = false;
hasShadow = true;
tooltip = dataList[i].lat+""+dataList[i].lng;
}
function createMarker():void{
var iterationMarker:Marker = new Marker(markerLatLng, markerOptions);
}
createMarker();
map.addOverlay(iterationMarker);
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en.

Reply via email to