I am trying to develop a simple photo album, where I have a
TileList control that displays the different photos as Thumbnail
view with respective name beneath the image. Therefore I am using a
custom component (a VBox component having an image and a label) as
an itemRenderer component for tiling the photos with names.
Now I wish to implement a sizing option for the thumbnails,
that is, I want to have three sizes of smaller, medium and large
sizes for the thumbnail images. I have three buttons and on
clicking these buttons the thumbnail size should change to the
My question is, is can we access the thumbnail image within
the itemRenderer component from outside the renderer component.
Can I access the 'imgDAAsset' from the main application mxml
to change the the width/height properties.
I also tried to accomplish the thumbnail sizing by adjusting
the Tilelist rowHeight and columnWidth, but by doing that the item
area for each tile increases but the renderer image is un-affected.
How can I increase the image size within the renderer
Is there any other way to perform the same operation?
Thanks and Regards,
TextMy main applicationRenderer component
From what I know, this kind of thing is hard to do with a
List-based component because renderers exist only for the visible
items (among other complications). Since all you want to do is
display your custom VBox in a tiled fashion, I suggest using the
Tile container instead. This way, you can just add instances of
your VBox to it and directly access each item. eg:
mypic = new CustomVBox();
mypic.init(...); //initialize with image data, etc.
Then you can refer to each child by using myTile.getChidAt().
When you want to resize the images, you can loop through every
child and make changes to mypic.imgDAAsset.
You cannot directly access the itemRenderer instance from the
main application. However, there is another way of doing it.
Override the setter data in your itemRenderer, set a variable which
indicates each image dimensions like _img which should be declared
in the parentApplication. On click of the button, reset the
dataProvider and since the itemRenderer listens to the variable
_img and redraws the image control accordingly.