Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
New Developer
jaggedaz
Posts: 21
Registered: ‎11-08-2010

Can't seem to load images into a TileList

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);
				
			}

 

Please use plain text.
Developer
jtegen
Posts: 6,145
Registered: ‎10-27-2010
My Carrier: AT&T

Re: Can't seem to load images into a TileList

Is your XML list of photos actual photos (bitmaps) or URL's to images? Can you set a regular Image added to a UIComponent/Sprite from the same XML (not added to tile list)? Trying to separate what might be the issue (source of the data or the image accepting the data).
Please use plain text.
New Developer
jaggedaz
Posts: 21
Registered: ‎11-08-2010

Re: Can't seem to load images into a TileList

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.

Please use plain text.