Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/06/2008, 15:16
nicolaspalma
 
Fecha de Ingreso: mayo-2008
Ubicación: Ñuñoa, Santiago.
Mensajes: 18
Antigüedad: 15 años, 11 meses
Puntos: 0
Película no carga bien los datos desde un xml.

Hola chicos,

Mi problema es que la película que he hecho no carga bien los datos desde un achivo xml. Esto se nota al momento de abrir la película desde el explorador, pues hay un objeto que debe ser cargado en una posición específica extraida desde el xml, pero lo hace a ratos, y necesito (obviamente) que la cargue el 100% de las veces, y no 1 de cada 10.
El archivo funciona de la siguiente forma:
- se carga el archivo
- la película llama a un objeto a través de loadMovie
- el objeto extrae la posición desde un xml.

aquí va el código que carga el xml:

var input_xml = new XML();
input_xml.ignoreWhite = true;
input_xml.contentType = "text/xml";
input_xml.onLoad = function(success){
if (success){
_root.velador_MC.send_btn._x = this.firstChild.firstChild.attributes.modx;
_root.velador_MC.send_btn._y = this.firstChild.firstChild.attributes.mody;
//nameevento.text = this.firstChild.firstChild.attributes.mitexto;
//namelugar.text = this.firstChild.firstChild.attributes.mifecha;
}
else{
modx.text = "Error loading input XML";
}
}

var output_xml = new XML();
output_xml.ignoreWhite = true;
output_xml.onLoad = function(success){
if (success){
modx_out = this.firstChild.firstChild.attributes.modx;
mody_out = this.firstChild.firstChild.attributes.mody;
//nameevento_output.text = this.firstChild.firstChild.attributes.mitexto;
}
else{
modx.text = "Error loading output XML";
}
}

var xml_file = "user.xml";
var server_file = "editor.user.php";

onLoad = function(){
input_txt.text = "Loading...";
input_xml.load(xml_file + "?uniq=" + new Date().getTime());
}
envi.onRelease = function(){
input_xml.firstChild.firstChild.attributes.modx = _root.velador_MC.send_btn._x;
input_xml.firstChild.firstChild.attributes.mody = _root.velador_MC.send_btn._y;
//input_xml.firstChild.firstChild.attributes.mitexto = nameevento.text;
input_xml.sendAndLoad(server_file, output_xml);
output_txt.text = "Loading...";
}



y aquí el que carga el otro swf:


_root.createEmptyMovieClip("velador_MC",1);
velador_MC.loadMovie("velador.swf");


espero me puedan ayudar con este problema, que ya me tiene enfermo.


Finalmente era una tontera, la solución era poner el código en el primer fotograma.


Bye;)

Última edición por nicolaspalma; 17/06/2008 a las 10:40