I am tring to create a simple tile list as part of an AS3 class, haveing looked at a few examples I do not seem to be able to populate it with data, neither addItem or dataPopulator seem to available to me, when using AS3 code.
using the simplest exampe I could find, (http://www.adobe.com/devnet/flash/quickstart/tilelist_component_as3/)
/* // these had to be changed to imports below to compile
private function tilelist():void
// Create TileList instance
var myTileList:TileList = new TileList();
// Add four images to the TileList instance
// Set scroll bar direction
myTileList.direction = ScrollBarDirection.HORIZONTAL;
// position TileList and set column and row values
myTileList.columnWidth = 200;
myTileList.rowHeight = 140;
myTileList.columnCount = 1;
myTileList.rowCount = 2;
myTileList.width = 200;
myTileList.height = 295;
// Add to the display (Stage)
fails to compile as the addItem method cannot be found
tried with a dataProvider, instead of add item, but that cannot be found either, and what is the include file for a dataProvider
whats am I doing wrong, and why do adobe not cover this in their example?
thanks in frustratuion .
You need to provide the dataProvider which is an ArrayCollection on which you do your addItem opertions:
private var myItemCollection:ArrayCollection = new ArrayCollection();
then in you code you assign it to your TileList.
myTileList.dataProvider = myItemCollection;
and you can then add your items ..