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.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 21
Registered: ‎11-08-2010
My Device: Not Specified

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

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

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).
Highlighted
New Developer
Posts: 21
Registered: ‎11-08-2010
My Device: Not Specified

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.

Developer
Posts: 102
Registered: ‎01-12-2011
My Device: Blackberry Playbook
My Carrier: DiGi twitter@TylorPin

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

May I know how do you add images in TileList? I put myTileList.addItem(myPic) but it doesn't add inside

Click "like" if my reply helps and click "Accept as Solution" if it solves your problem!

twitter @Twopinstudio
my vendor page https://appworld.blackberry.com/webstore/vendor/7126/?lang=en
Developer
Posts: 1,269
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

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

See my response in the other TileList related thread you responded to:

 

http://supportforums.blackberry.com/t5/Adobe-AIR-Development/Tile-List-Irregular-behavior/td-p/13536...