class Destino{
private var str_nombre:String;
private var str_descripcion:String;
public var onCarga:Function;
function Destino(){
_global.esto = this;
var conf_xml:XML;
conf_xml = new XML();
conf_xml.ignoreWhite = true;
conf_xml.onLoad = cargarXML;
conf_xml.load("DataBase/destinos.xml");
str_nombre = "DATO0"
str_descripcion = "DATO1"
}
private function cargarXML(exito:Boolean) {
if (exito) {
var nodo:XML = new XML();
nodo = XML(this);
_global.esto.str_nombre = nodo.firstChild.childNodes[1].firstChild.nodeValue;
_global.esto.str_descripcion = "percy";//nodo.firstChild.childNodes[0].firstChild.nodeValue;
_global.esto.onCarga();
} else {
trace("Error al cargar XML");
}
}
public function XMLLoad(){
var nodo:XML = new XML();
nodo.ignoreWhite = true;
nodo.load("DataBase/destinos.xml");
str_nombre = "WSW";
str_descripcion = nodo.firstChild.childNodes[0].firstChild.nodeValue;
}
public function get nombre():String {
return this.str_nombre;
}
public function get descripcion():String {
return this.str_descripcion;
}
}