Highlighted

refresh image in itemrenderer

Avatar

Avatar

BlueVeinz

Avatar

BlueVeinz

BlueVeinz

25-03-2009

Hello,



I'm populating my tilelist with an itemrenderer. In this
itemrenderer I'm having an image and textbox. The textbox is
bindable, but my image isn't, because it's getting his source using
the image.load method. Is there any way I can refresh my image when
the datasource of the tilelist changes? (the textfield changes
properly).

Here's some examplecode.



private function init():void {

base64Dec = new Base64Decoder();

base64Dec.decode(data.comiccover); //used to decode the
incoming url

byteArr = base64Dec.toByteArray();

img.load(byteArr);

}



<mx:Image width="100" id="img" />

<mx:Text text="{data.title}" id="txtTitle" />



Replies

Highlighted

Avatar

Avatar

Greg_Lafrance

Avatar

Greg_Lafrance

Greg_Lafrance

01-04-2009

You might be able to add a collectionChange event listener to
the TileList dataProvider collection, and have that listener call
the function to reload the image.