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" <[EMAIL PROTECTED]> 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>
>


Reply via email to