Código PHP:
   stop();
#include "lmc_tween.as"
var miXML:XML = new XML();
var i:Number = 0;
var cual:Number = 0;
var arrayBarcos:Array = new Array();
var arrayPuertos:Array = new Array();
miXML.load("getDataFromDb.asp");
miXML.ignoreWhite = true;
miXML.onLoad = function(chido:Boolean) {
    if (chido) {
        setArrayBarcos();
        obt.gotoAndStop(1);
    } else {
        obt.gotoAndPlay(2);
    }
};
 
 
 
puertosXML = new XML();
puertosXML.load(_global.configMap);
puertosXML.ignoreWhite = true;
puertosXML.onLoad = function(yaesta:Boolean) {
    if (yaesta) {
        setArrayPuertos();
        getBarcos();
        obt.gotoAndStop(1);
    } else {
        obt.gotoAndPlay(2);
    }
};
function setArrayPuertos() {
    for (i=0; i<puertosXML.firstChild.childNodes.length; i++) {
        nodes = puertosXML.firstChild.childNodes[i].childNodes;
        pos = nodes[0].firstChild.nodeValue;
        x_pos = nodes[1].firstChild.nodeValue;
        y_pos = nodes[2].firstChild.nodeValue;
        rot = nodes[3].firstChild.nodeValue;
        arrayPuertos.push({posex:pos, x_pos:x_pos, y_pos:y_pos, r:rot});
    }
}
function setArrayBarcos() {
    for (i=0; i<miXML.firstChild.childNodes.length; i++) {
        nodes = miXML.firstChild.childNodes[i].childNodes;
        id = nodes[0].firstChild.nodeValue;
        nombre = nodes[1].firstChild.nodeValue;
        pos = nodes[2].firstChild.nodeValue;
        carga = nodes[3].firstChild.nodeValue;
        arribo = nodes[4].firstChild.nodeValue;
        atraque = nodes[5].firstChild.nodeValue;
        etd = nodes[6].firstChild.nodeValue;
        arrayBarcos.push({ID:id, nombre:nombre, posicion:pos, carga:carga, arribo:arribo, atraque:atraque, etd:etd});
    }
}
function getBarcos() {
    for (i=0; i<miXML.firstChild.childNodes.length; i++) {
        //trace(arrayBarcos[i].ID);
        //trace(arrayBarcos[i].nombre);
        //trace(arrayBarcos[i].posicion);
        var dinamico = attachMovie(arrayBarcos[i].ID, arrayBarcos[i].ID+i, getNextHighestDepth());
        dinamico._y = 0;
        dinamico._x = 0;
        dinamico.Nombre = arrayBarcos[i].nombre;
        dinamico.ID = arrayBarcos[i].ID;
        dinamico.Pos = arrayBarcos[i].posicion;
        dinamico.carga = arrayBarcos[i].carga;
        dinamico.arribo = arrayBarcos[i].arribo;
        dinamico.atraque = arrayBarcos[i].atraque;
        dinamico.etd = arrayBarcos[i].etd;
        dinamico.tween("_x",devuelvePosicionx(i),1,"easeOut");
        dinamico.tween("_y",devuelvePosiciony(i),1,"easeOut");
        dinamico.alphaTo(100,3,"easeOut");
        if (debeRotar(i) != 0) {
            dinamico.rotateTo(debeRotar(i),1,"easeoutback");
        }
    }
    mensaje.swapDepths(getNextHighestDepth());
}
 
function devuelvePosicionx(idpos) {
    for (j=0; j<puertosXML.firstChild.childNodes.length; j++) {
        if (arrayBarcos[idpos].posicion == arrayPuertos[j].posex) {
            return arrayPuertos[j].x_pos;
        }
    }
}
 
function devuelvePosiciony(idpos) {
    for (j=0; j<puertosXML.firstChild.childNodes.length; j++) {
        if (arrayBarcos[idpos].posicion == arrayPuertos[j].posex) {
            return arrayPuertos[j].y_pos;
        }
    }
}
function debeRotar(idpos) {
    for (j=0; j<puertosXML.firstChild.childNodes.length; j++) {
        if (arrayBarcos[idpos].posicion == arrayPuertos[j].posex) {
            return arrayPuertos[j].r;
        }
    }
} 
     
 

 
  
 
