[COLOR=red]The Xml[/COLOR]
<?xml version=“1.0”?>
<root>
<route portStart = “USLAX”
portStartx = “2014”
portStarty = “433”
portEnd = “JPTYO”
portEndx = “1995”
portEndy = “456” />
</root>
[COLOR=black]Can anybody tell me why this does not work ?:crazy:[/COLOR]
[COLOR=red]the script:[/COLOR]
var xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = processXMLData;
xmlData.load(“fly_attb.xml”);
xmlData.onLoad = function(success) {
if (success) {
[INDENT]var flyData = xmlData.firstChild.childNodes;
for (i=0; i<flyData.length; i++) {
var currRoute = flyData*;
var speed = 1.1;
var mc = this.createEmptyMovieClip(“line_mc”, 10);
var currentEndPointX = startX=currRoute.attributes.portStartx;
var currentEndPointY = startY=currRoute.attributes.portStarty;
var endX = currRoute.attributes.portEndx;
endY = currRoute.attributes.portEndy;
mc.onEnterFrame = function() {
[INDENT]currentEndPointX = endX-(endX-currentEndPointX)/speed;
currentEndPointY = endY-(endY-currentEndPointY)/speed;
this.clear();
this.lineStyle(1,0x3300FF,1000);
this.moveTo(startX,startY);
this.lineTo(currentEndPointX,currentEndPointY);
trace(endX-currentEndPointX);
trace(endY-currentEndPointY);
if (Math.abs(endX-currentEndPointX)<1 && Math.abs(endY-currentEndPointY)<1) {
[INDENT]endX = currentEndPointX;
endY = currentEndPointY;
delete this.onEnterFrame;
[/INDENT]}
};
[/INDENT]}// end for
[/INDENT]} else {
content = “not found”;
}
};
thank you for your help and consideration!