Foros del Web » Creando para Internet » Flash y Actionscript »

acceder a los nodos de un xml desde flash

Estas en el tema de acceder a los nodos de un xml desde flash en el foro de Flash y Actionscript en Foros del Web. 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"?> ...
  #1 (permalink)  
Antiguo 28/04/2005, 09:44
Avatar de nadal83  
Fecha de Ingreso: abril-2005
Mensajes: 7
Antigüedad: 19 años
Puntos: 0
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
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:59.