Comunidad de diseño web y desarrollo en internet online

ayuda con un script mu tonto

Citar            
MensajeEscrito el 19 Sep 2006 11:22 am
holas, tengo un problemilla al meter lso resultados de un xml en un array, para poder después colocar los nombres de los botones etc en cualquier idioma (en función del xml que cargue), hasta ahi bien, pero el caso es que no consigo la manera de que el array (creado fuera de la funcion onLoad) que creo y el que se me rellena en la funcion onLoad sean el mismo, no se porque porque lo he hecho _global y tampoco funciona. Bueno os dejo el script que lo vereis más facil.

var Idioma = "es";

System.useCodepage = true;

var textoInterface:XML = new XML();
textoInterface.ignoreWhite = true;
sections = new Array();
textoInterface.load("XML/interface-"+Idioma+".xml");
textoInterface.onLoad = function()
{
sections["soluciones"] = textoInterface.firstChild.firstChild.childNodes[0].attributes.titulo;
sections["smart"] = textoInterface.firstChild.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
sections["quees"] = textoInterface.firstChild.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
sections["productos"] = textoInterface.firstChild.firstChild.childNodes[1].attributes.titulo;
sections["sistemas"] = textoInterface.firstChild.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
sections["pintura"] = textoInterface.firstChild.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
sections["complementos"] = textoInterface.firstChild.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
sections["contactar"] = textoInterface.firstChild.firstChild.childNodes[2].attributes.titulo;
sections["datos"]=textoInterface.firstChild.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
sections["bkpag"]=textoInterface.firstChild.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
}

recordad que ya lo he probado con _global tanto al crear como al referirme al array desde dentro de la función.

Por chaosburn

20 de clabLevel



Genero:Masculino  

Alicante-España

firefox
Citar            
MensajeEscrito el 19 Sep 2006 07:45 pm
Lo que quieres usar es un Object, no un Array.

Por Zah

BOFH

4290 de clabLevel

27 tutoriales
5 articulos

  Bastard Operators From Hell Editores

Zaragoza, España

firefox
Citar            
MensajeEscrito el 20 Sep 2006 08:29 am
Bueno no se si lo del objeto me va a ayudar, pero creo ke no has entendido mi problema.

el caso es que use un ojbect o un array (lo he probado con ambos), la función onLoad me rellena un Array/Object o lo ke sea interno(local) en la función y no el array que he creado fuera de ella, que es lo que necesito que haga para después poder referirme a él.

he probado usando _global y no me da resultado.

¿alguien sabe como es esto?

Por chaosburn

20 de clabLevel



Genero:Masculino  

Alicante-España

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.