Impecable, luego probare todo.
muchas gracias!!
----- Original Message -----
From: "Joseba Alonso" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 21, 2003 10:35 AM
Subject: Re: [ASNativos] [flmx+xml] problema para obtener datos de xmlextrno


> bueno, te veo un monton de problemas. Te doy algunos basicos para que
> funcione minimamente bien:
>
> 1- Declara tus variables:
>
> var totalbot,nombres,textbot
>
> 2- Si usas cambios de linea y tabulaciones en tu archivo xml usa:
>
>     mixml.ignoreWhite = true;
>
> 3- No te bases en una cantidad de fotogramas para hacer el parse del XML,
> eso mas tarde o mas temprano fallara. Usa el evento onLoad
>
> function cargado(){
>     nombres = mixml.firstChild.childNodes;
>     for (i in nombres) {
>      if (nombres[i].nodeName == "boton") {
>         // Resto del codigo
> }
> mixml.onLoad = cargado;
>
> 4- Utiliza callbacks, no uses eventos de clip:
>
> function click(){
>     clip.texto = this.texto;
> }
>
>
>  if (nombres[i].nodeName == "boton") {
>     textbot = new Array();
>     textbot[0] = nombres[i].firstChild.nodeValue;
>     textbot[1] = nombres[i].attributes.nombre;
>     clip = eval("_root.boton"+(i+1));
>     clip.onRelease = click;
>     clip.texto = textbot[0];
> }
>
> Con esto puedes funcionar en un solo frame
>
> A ver si con esto afinas m�s ;)
>
> un saludo
>
> Joseba Alonso
> www.sidedev.net
> ----- Original Message -----
> From: "Luis" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 20, 2003 7:11 PM
> Subject: [ASNativos] [flmx+xml] problema para obtener datos de xml extrno
>
>
> Hola.
> Primero que nada un saludo a todos los listeros , este es mi primer
mensaje
> y espero me puedan ayudar.
> Estoy aprendiendo sobre el xml , arrays y flash y tengo algunas dudas...
>
> Problema:
> Tengo un menu, el cual toma de un xml externo los nombres de los botones y
> tambien los textos que carga cada uno de los botones.
> El xml externo es de este estilo:
>  <botones>
>    <boton nombre="boton1">Este es el texto que carga el boton N�1.
</boton>
>    <boton nombre="boton2">Este es el texto que carga el boton N�2.
</boton>
>    <boton nombre="boton3">Este es el texto que carga el boton N�3.
</boton>
> </botones>
>
> //  En el fotograma 1 de la pelicula cargo el xml:
>
> mixml = new XML();
> mixml.load("xmlexterno.xml");
>
> // En el fotograma 5 tengo tres botones cada uno con un  campo de texto
> din�mico en donde cargara el nombre del mismo (bot1, bot2,bot3), tambien
> tengo un cuadro de texto din�mico (llamado texto) en donde cargaran los
> textos que mande cada boton.
> // El codigo que pongo en el fotograma 5 es:
>
> totalbot = new Array();
> nombres = new Array();
> nombres = mixml.firstChild.childNodes;
> for (i in nombres) {
>  if (nombres[i].nodeName == "boton") {
>     textbot = new Array();
>     textbot[0] = nombres[i].firstChild.nodeValue;
>     textbot[1] = nombres[i].attributes.nombre;
>    }
>  totalbot.push(textbot);
> }
>
> //el problema esta en que el array totlabot me queda mal formado, y he
> tenido que tantear para poder asignar a cada boton el nombre y texto que
> cargara..
>
> bot1 = totalbot[6][1];
> bot2 = totalbot[4][1];
> bot3 = totalbot[2][1];
> stop();
>
> //El codigo en los botones es:
>     //boton1:
> on (release) {
>  clip.texto = totalbot[6][0];
> }
>     //boton2:
> on (release) {
>  clip.texto = totalbot[4][0];
> }
>    //boton3:
> on (release) {
>  clip.texto = totalbot[2][0];
> }
>
> Les dejo todo el codigo para que lo analizen y me digan que  hago mal, o
que
> se puede mejorar.
>
> saludos y gracias
>
> <!-------------------------------
> Lista ASNativos:
> subscripciones/desubscripciones
> http://www.sidedev.net/asnativos
> -------------------------------->
>
> <!-------------------------------
> Lista ASNativos:
> subscripciones/desubscripciones
> http://www.sidedev.net/asnativos
> -------------------------------->
>
<!-------------------------------
Lista ASNativos:
subscripciones/desubscripciones
http://www.sidedev.net/asnativos
-------------------------------->

Responder a