It's the "var latlng[i] = ..." ;) You mean latlng.push(new LatLng(pointx...@lat, pointx...@lng));
Beside this, there will be a "Duplicate variable definition" error because of the i in both for-loops. With these changes the code should be fine. Regards, Darek On 30 Jan., 23:16, AK <[email protected]> wrote: > Hello, > > i try to integrate my polylines from a XML-file like this: > (because i integrate my markers with the same structure from the > demogallery:http://gmaps-samples-flash.googlecode.com/svn/trunk/demos/XmlParsingD...) > > <polylines> > <polyline line="01-01" color="#000000"> > <point lat="42.4887713137" lng="12.2608362436"/> > <point lat="42.4889593030" lng="12.2608402669"/> > <point lat="42.4892828383" lng="12.2608302087"/> > <point lat="42.4893703881" lng="12.2608261853"/> > </polyline> > <polyline line="01-02" color="#000000"> > <point lat="41.4887713137" lng="13.2608362436"/> > <point lat="41.4889593030" lng="13.2608402669"/> > <point lat="41.4892828383" lng="13.2608302087"/> > <point lat="41.4893703881" lng="13.2608261853"/> > </polyline> > </polylines> > > But it doesn´t work... > I allways become an error message: > 1086 - Syntax error: expecting semicolon before leftbracket. > But i think there is no semicolon missing. :-/ > > public function getTest():void > { > var xmlString:URLRequest = new URLRequest("polyline.php"); > var xmlLoader:URLLoader = new URLLoader(xmlString); > xmlLoader.addEventListener("complete", readXmlTest); > > } > > public function readXmlTest(event:Event):void > { > var polylinesXML:XML = new XML(event.target.data); > var polylines:XMLList = polylinesXML.polyline; > var polylinesCount:int = polylines.length(); > var i:Number; > for (i=0; i < polylinesCount; i++) > { > var polylineXml:XML = polylines[i]; > var line:String = polylinex...@line; > var color:String = polylinex...@color; > > var latlng:Array = new Array(); > > var polyline:XMLList = polylineXML.point; > var polylineCount:int = polyline.length(); > var latlng:Array = new Array(); > var i:Number; > for (i=0; i < polylineCount; i++) > { > var pointXml:XML = polyline[i]; > var latlng[i] = new LatLng(pointx...@lat, pointx...@lng); << > Error line > } > > var poly:Polyline = new Polyline(latlng); > map.addOverlay(poly); > } > > } > > Is there a way to integrate the polylines with this code? > > Thanks very much... > AK -- 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.
