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

cargar jpg desde un xml

Estas en el tema de cargar jpg desde un xml en el foro de Flash y Actionscript en Foros del Web. Hola tengo un xml que se ve asi: <cliente> <titulo>Edificio Golden</titulo> <foto url='images/foto1.jpg' /> <dateline>Nuevo Edificio en el centro de la Ciudad</dateline> </cliente> y no ...
  #1 (permalink)  
Antiguo 17/01/2008, 13:03
 
Fecha de Ingreso: junio-2004
Mensajes: 66
Antigüedad: 19 años, 10 meses
Puntos: 0
cargar jpg desde un xml

Hola tengo un xml que se ve asi:

<cliente>
<titulo>Edificio Golden</titulo>
<foto url='images/foto1.jpg' />
<dateline>Nuevo Edificio en el centro de la Ciudad</dateline>
</cliente>

y no tengo problemas para traer lo que es texto, pero no puedo hacer que me cargue la foto en un mc vacio. esto es lo que tengo en el frame:

var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
obj_xml.onLoad = function(exito) {

if (exito) {

titulo_txt.text = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
desc_txt.text = obj_xml.firstChild.childNodes[1].firstChild.nodeValue;
remitente_txt.text = obj_xml.firstChild.childNodes[2].firstChild.nodeValue;

}
};

obj_xml.load("alepru.xml");


alguien puede ayudarme

gracias
  #2 (permalink)  
Antiguo 17/01/2008, 13:27
Avatar de sheshu  
Fecha de Ingreso: abril-2006
Ubicación: En too el medio
Mensajes: 160
Antigüedad: 18 años
Puntos: 0
Re: cargar jpg desde un xml

hola, prueba con:
Código:
if (exito) {
titulo_txt.text = obj_xml.firstChild.childNodes[0].firstChild.toString();
desc_txt.text = obj_xml.firstChild.childNodes[1].firstChild.toString();
remitente_txt.text = obj_xml.firstChild.childNodes[2].firstChild.toString();
}
saludos,

sheshu
__________________
sheshu ::: www.tutoriales-flash.com
  #3 (permalink)  
Antiguo 17/01/2008, 13:32
 
Fecha de Ingreso: junio-2004
Mensajes: 66
Antigüedad: 19 años, 10 meses
Puntos: 0
Re: cargar jpg desde un xml

si pero mi mc se llama cont, que lineas tengo que poner para que se cargue ahi la foto
  #4 (permalink)  
Antiguo 18/01/2008, 02:11
Avatar de ganCT  
Fecha de Ingreso: enero-2008
Ubicación: Vigo
Mensajes: 78
Antigüedad: 16 años, 3 meses
Puntos: 0
Re: cargar jpg desde un xml

var obj_xml:XML = new XML();
obj_xml.ignoreWhite = true;
obj_xml.onLoad = function(exito) {
if (exito) {
var ruta:String = obj_xml.firstChild.childNodes[1].attributes["url"];
trace(ruta);

cont.loadMovie(ruta);
}
};
obj_xml.load("xml.xml");
;
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:20.