|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Junior Member
Iscritto dal: Sep 2008
Messaggi: 17
|
[ActionScript3] Reperire la sorgente dell'elmento nell'UILoader
Ciao a tutti,
ho questo problema: In base ad un XML creo una galleria di immagini grazie a un for che genera tanti UILoader quanto detto nell'xml e vi inserisce dentro le immagini jpg tramite gli url scritti sempre nell'xml. Ora a me serve ricavare l'url dell'immagine presente nell'UILoader sul quale l'utente clicca. Ho provato a fare così: Codice:
var xmlImg:XML = new XML(e.target.data);
var thumbW:uint = xmlImg.attribute("thumbWidth");
var thumbH:uint = xmlImg.attribute("thumbHeight");
for(var i:uint; i < xmlImg.img.length(); i++){
req = new URLRequest(xmlImg.img[ i ].path);
thumbnail = new UILoader();
thumbnail.load(req);
thumbnail.x = 0;
thumbnail.y = i*thumbH;
thumbnail.setSize(thumbW,thumbH);
thumbnail.addEventListener(MouseEvent.MOUSE_OVER, zoom);
thumbnail.addEventListener(MouseEvent.CLICK, imgChange);
addChild(thumbnail);
}
function zoom(e:MouseEvent){
}
function imgChange(e:MouseEvent){
trace(e.target);
}
come posso fare? Grazie in anticipo ^^ |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 11:20.



















