Target is the dispatcher, which is the loader of the image.  Try
currentTarget, or use rptFoto.getRepeaterItem

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of danielvlopes
Sent: Saturday, September 15, 2007 8:57 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problem with repeater and image ???

 

Helo everybody...

I having problems to try get repearter item when user click on image.

This is my code for repeater:
<mx:Repeater id="rptFoto" dataProvider="{objSelectedEquip.thumbs}">
<mx:HBox>
<mx:Image 
source="{rptFoto.currentItem}" 
buttonMode="true"
useHandCursor="true"
toolTip="Vizualizar"
click="exibirImagem(event)"/>
<mx:Button label="Alterar" click="exibirImagem(event)" /> 
</mx:HBox> 
</mx:Repeater>

When user click on button or image this function is called:

private function exibirImagem(event:MouseEvent):void{

var image:String = event.target.getRepearterItem();
var imgUrl:URLRequest = new
URLRequest(Funcoes.getImageFromThumb(image));
navigateToURL(imgUrl,"_blank");
}

When user click on button everything work, but whe click image this
error is dispatched "Property getRepeaterItem not found on
mx.core.FlexLoader and there is no default value." , anyone know some
way to fix this?

Thanks.

 

Reply via email to