Retroceder   Foros del Web > Programación para sitios web > XML

Respuesta
 
Herramientas Desplegado
Antiguo 28-abr-2005, 10:38   #1 (permalink)
nadal83 ha deshabilitado el karma
 
Avatar de nadal83
 
Fecha de Ingreso: abril-2005
Mensajes: 5
acceder a los nodos de un xml desde flash

hola a todos, quiero acceder desde flash a los nodos de un xml, ahora os explico.
tengo el siguiente código xml:
Código:
<?xml version="1.0" encoding="iso-8859-1"?>
<datos>
	<botones>
		<boto0>
			<repos>
				<general>
					<setRGB>0xFF0000</setRGB>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
					
				</general>
				<text>
					<text>Marcel</text>
					<font>verdana</font>
					<fontColor>0xFFFFFF</fontColor>
					<italic>1</italic>
					<bold>1</bold>
					<underline>0</underline>
					<align>Center</align>
					<size>22</size>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
				</text>	
			</repos>
			<sobre>
				<general>
					<setRGB>0xFFFF00</setRGB>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
					
				</general>
				<text>
					<text>Marcel</text>
					<font>verdana</font>
					<fontColor>0x000000</fontColor>
					<italic>1</italic>
					<bold>1</bold>
					<underline>0</underline>
					<align>center</align>
					<size>22</size>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
				</text>	
			</sobre>
			<pulsat>
				<general>
					<setRGB>0x0000FF</setRGB>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
					
				</general>
				<text>
					<text>Marcel</text>
					<font>verdana</font>
					<fontColor>0xFFFFFF</fontColor>
					<italic>1</italic>
					<bold>1</bold>
					<underline>0</underline>
					<align>center</align>
					<size>22</size>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
				</text>	
			</pulsat>
		</boto0>
		<boto1>
			<repos>
				<general>
					<setRGB>0xFF0000</setRGB>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
					
				</general>
				<text>
					<text>Nadal</text>
					<font>verdana</font>
					<fontColor>0xFFFFFF</fontColor>
					<italic>1</italic>
					<bold>1</bold>
					<underline>0</underline>
					<align>center</align>
					<size>22</size>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
				</text>	
			</repos>
			<sobre>
				<general>
					<setRGB>0xFFFF00</setRGB>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
					
				</general>
				<text>
					<text>Nadal</text>
					<font>verdana</font>
					<fontColor>0x000000</fontColor>
					<italic>1</italic>
					<bold>1</bold>
					<underline>0</underline>
					<align>center</align>
					<size>22</size>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
				</text>	
			</sobre>
			<presionat>
				<general>
					<setRGB>0xFFFFFF</setRGB>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
					
				</general>
				<text>
					<text>Nadal</text>
					<font>verdana</font>
					<fontColor>0xFF0000</fontColor>
					<italic>1</italic>
					<bold>1</bold>
					<underline>0</underline>
					<align>center</align>
					<size>22</size>
					<_x>0</_x>
					<_y>0</_y>
					<_width>150</_width>
					<_height>75</_height>
				</text>	
			</presionat>
		</boto1>
	</botones>
</datos>
y tengo el siguiente código flash:
Código:
mixml = new XML();
mixml.load("prova.xml");
mixml.ignoreWhite = true;
mixml.onLoad = carregar;
function carregar()
{
	mixml = this.firstChild.firstChild;
	nodoBoton=mixml.childNodes[0];
	trace(nodoBoton);
}
al hacer el trace me saca el nodo del <boto0>,
pero jo quiero que en canviar el trozo de código que pone:
Código:
nodoBoton=mixml.childNodes[0];
por:
Código:
nodoBoton=mixml.childNodes["boto0"];
o algo similar, ya que con esta orden no me funciona.
muchas gracias
nadal83 está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 07:48.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93