Thanks Darek for the fast answer... :-)

I have changed the code.
Now there´s no error and no duplicate variable definition warning for
the "i"
and for the "var latlng:Array = new Array();".

But there are no polylines on my map although he´s reading the xml
file.
I have checked this via ff live header...

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 polylineXML:XML = new XML(event.target.data);
                var polyline:XMLList = polylineXML.point;
                var polylineCount:int = polyline.length();
                var a:Number;
                for (a=0; a < polylineCount; a++)
                {
                        var pointXml:XML = polyline[a];
                        latlng.push(new LatLng(pointx...@lat, pointx...@lng));
                }
                var poly:Polyline = new Polyline(latlng);
                map.addOverlay(poly);
        }
}

I think i need a second function with the options of the polyline to
show it on the map...
Hmmmmm...

Greetings, AK


On 1 Feb., 16:52, Darek <e-b...@web.de> wrote:
> 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

-- 
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 google-maps-api-for-fl...@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-api-for-flash+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en.

Reply via email to