06-08-2011 02:29 AM
I'm having some trouble creating a tile list containing image thumbnails. Anyone have experience with this? Does TileList accept Images? Here's what my code currently looks like:
var grid:TileList = new TileList();
grid.setPosition(0, 0);
grid.width = 1024;
grid.height = 600;
grid.columnCount = 5;
grid.cellPadding = 5;
this.addChild(grid);
for (var i:int = 0; i < images.photo.length(); i++) {
var curPhoto:XMLList = XMLList(images.photo[i]);
var gridImage:Image = new Image();
gridImage.setImage(curPhoto.@url_sq);
grid.addItem(gridImage);
}
06-08-2011 07:07 AM
06-08-2011 05:16 PM
Hi jtegen, thanks for the reply.
The XML contains the photo URLs, so what I'm passing setImage is a URL. I'll do some testing later tonight to see if I can just add an Image to the stage to see if the Image is working.
I have a feeling that TileList doesn't like images and it expects them to be wrapped in something else. The examples in the API docs just show an object with a label property...no example of an image.