I made this class, which is an ItemRenderer class, used in a DataGroup ( mobile application ), and I am not entirely sure if I did the right thing or not, my issues are :
- Is there a better way to show the image, which is 80x80 and directly loaded from the server;
- How to make the height of the row dynamic, I mean, depending on the height of the 3 StyleableTextFeild
- Is this the right way to add the listener on the image, that will trigger a simple HTTPService,
Here is the functions from the class, Any help would be much appreciated !!
- Image
Declared it as a simple image :
var logo:Image;
On override createChildren
logo = new Image();
addChild(logo);
And I added on set Data
logo.source = "http://192.168.0.15:3000/"+value.logo_thumb_url;
Size
override protected function measure():void { measuredWidth = measuredMinWidth = stage.fullScreenWidth; measuredHeight = measuredMinHeight = 100; }
Listener
override public function set data(value:Object):void { tel.text = String(value.Tel); description.text = String(value.Descricao); nome.text = String(value.Nome); logo.addEventListener(MouseEvent.CLICK, function():void{ var service:HTTPService = new HTTPService(); service.url = value.targer; service.method = "GET"; // setting headers and other variables ... service.send(); }); }