Title: Associative array as dataProvider

I have an associative array in a variable created like so:

        goData = new Object();

        var oData:Object;

        for ( var i:Number=0; i<5; i++ )  {

                oData = new Object({name:"Name of item " + i})

                goData["key" + i] = oData;

        }//for ( var i:Number=0;....

I can iterate through it and see the data fine.

But how do I reference it in the dataProvider property to get an item for each element? Using toArray() results in a single item with 5 properties. (I can see them in the FB debugger with a breakpoint on the label function) Without toArray the labelFunction item is undefined.

And if Iget that, how do I return the key value in the label function?

My goal is a 2 column DataGrid with the key/property name in one column and the dataObject.name value inthe second.

Tracy

Reply via email to