el xml tengo esto:
Código HTML:
<?xml version="1.0" encoding="utf-8"?> <imagenes> <imagen id="mini/foto1.jpg" descri="tarrito" datos="se almacena 100 grs. de jamon cocido."/> <imagen id="mini/foto2.jpg" descri="jamon" datos="se almacena 500 grs. de jamon cocido."/> <imagen id="mini/foto3.jpg" descri="salchichon" datos="se almacena 1880 grs. de jamon cocido."/> <imagen id="mini/foto4.jpg" descri="bondiola" datos="se almacena 80 grs. de jamon cocido."/> </imagenes>
Código HTML:
x = -220;
y = -20;
ancho = 100;
alto = 70;
var mxml:XML = new XML();
mxml.ignoreWhite = true;
mxml.onLoad = function(succes:Boolean) {
if (succes) {
for (var i = 0; i<this.firstChild.childNodes.length; i++) {
var item:MovieClip = fotos_mc.createEmptyMovieClip("diapo"+i, fotos_mc.getNextHighestDepth());
item.loadMovie(this.firstChild.childNodes[i].attributes.id);
fotos_mc.onPress = function(){
texto_txt.text = this.attributes.datos;
}
// for (var a = 0; a<this.firstChild.childNodes.length; a++) {
//texto_txt.text=item=this.firstChild.childNodes[i].attributes.descri;
//fotos_mc.createEmptyMovieClip("diapo"+i,fotos_mc.getNextHighestDepth());
// }
item._x = x;
item._y = y;
x += ancho;
columna += 1;
if (columna == num_columnas) {
columna = 0;
x -= (ancho*num_columnas);
y += alto;
}
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Arial";
my_fmt.size = 10;
my_fmt.color = 0x000000;
fotos_mc.createTextField("texto_txt"+i,fotos_mc.getNextHighestDepth(),item._x,item._y+alto,ancho,30);
itemtext = fotos_mc["texto_txt"+i];
itemtext.multiline = true;
itemtext.wordWrap = true;
itemtext.text = this.firstChild.childNodes[i].attributes.descri;
itemtext.setTextFormat(my_fmt);
}
}
};
mxml.load("datos.xml");
stop();
Resumiendo: lo que quiero hacer es cuando me aparecen las fotos, hago clic en cada foto y me trae la descripcion de cada foto en el campo de texto (texto_txt)
Ojala me puedan ayudar!"!!! GRACIAS de antemano!!!!


