Try using an ArrayCollection for your data provider instead of a simple array.
--- In flexcoders@yahoogroups.com, "erinwyher" <[EMAIL PROTECTED]> wrote: > > Thanks for the suggestion, but it doesn't work :(. Do you need the > latest version of Flex 2 for that to work? I didn't install the latest > upgrade (2.1 I believe). > > When I tried it, I got the following error. > > TypeError: Error #1006: value is not a function. > at test/clickedList() > at test/___Button1_click() > > Also, in the debugger, IList(myTiles.dataProvider) cannot be evaluated, > and neither can IList(myTiles.dataProvider).getItemAt(any_number) > > Any more ideas? I really need help with this and I appreciate any > suggestions! Thank you. > > -Erin > > --- In flexcoders@yahoogroups.com, "bhaq1972" <mbhaque@> wrote: > > > > the getItemAt() function is available but not like the flex 1.5 way. > > > > you can do the following > > > > import mx.collections.IList; > > > > public function clickedList():void { > > //myTiles.getItemAt(1).testFunction(); > > IList(myTiles.dataProvider).getItemAt(1).testFunction(); > > etc > > > > > > > > --- In flexcoders@yahoogroups.com, "erinwyher" erinwyher@ wrote: > > > > > > In Flex 1.5, you use getItemAt() to call functions from the > > children > > > of the TileList, but that method no longer exists in F2. Any > > > suggestions to do this? > > > > > > Here is some sample code: > > > > > > test.mxml: > > > <?xml version="1.0" encoding="utf-8"?> > > > <mx:Application > > > xmlns:mx="http://www.adobe.com/2006/mxml" > > > xmlns:view="view.*" > > > layout="absolute" > > > creationComplete="doInit()"> > > > <mx:Script> > > > <![CDATA[ > > > public var arrTest:Array; > > > > > > public function doInit():void { > > > arrTest = [1,2,3,4]; > > > myTiles.dataProvider = arrTest; > > > } > > > public function clickedList():void { > > > //myTiles.getItemAt(1).testFunction > > (); > > > //I want to call a function here for > > a specific set of tiles... > > > how do I do that without getItemAt? > > > //Note: getChildAt does not work > > either > > > } > > > ]]> > > > </mx:Script> > > > <mx:Button label="click me" click="clickedList()"/> > > > > > > <mx:TileList id="myTiles" width="660" > > itemRenderer="view.TestComponent"/> > > > > > > </mx:Application> > > > > > > TestComponent.mxml > > > <?xml version="1.0" encoding="utf-8"?> > > > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="40" > > > height="30" backgroundColor="#FF3366"> > > > <mx:Script> > > > <![CDATA[ > > > import mx.controls.Alert; > > > > > > public function testFunction():void { > > > Alert.show('hi'); > > > } > > > ]]> > > > </mx:Script> > > > </mx:Canvas> > > > > > >