When using a List component, instead of a Repeater, how do I transfer a value from the dataprovider to the itemRenderer?
For example, I have an array collection (projectsAC) that contains arrays with the following structure:
projectsAC(
0:
Array(
0:number
1:string
2:string
3:string
4:XMLList
)
1:
Array(
0:number
1:string
2:string
3:string
4:XMLList
)
Ect.....
)
I use this array collection as the data provider and a custom module for the item renderer.
How do I access the array values from within the module? I've got the following so far:
<mx:List id="directorsPrepList" dataProvider="{projectsAC}" itemRenderer="modules.project" />
Here's what my projects module looks like right (just for testing purposes)
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:Scheduler="modules.*" layout="absolute" creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
[Bindable] public var allData:Array = data as Array;
private function init():void
{
Alert.show(String(allData[0]));
}
]]>
</mx:Script>
</mx:Module>
The program stalls during it's initialization... see anything wrong?