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ì:
Il trace restituisce [Object Loader] che è diverso dall'UILoader e che quindi non ha più l'attributo source, ma l'attributo content... che mi restituisce [Object Bitmap] e anche da questa classe non riesco a trovare un modo per ricavare l'url dell'immagine cliccata....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 ^^

Rispondi quotando
