Flash Action Script Error Repository

A library of solutions to Actionscript, Flash, Flex and AIR

Initializer for ‘dataProvider’: values of type mx.collections.IList cannot be represented in text.

Initializer for 'dataProvider': values of type mx.collections.IList cannot be represented in text.

Problem

The problem is we are not enclosing the reference to array collection with curly braces. The list component thinks that we are passing a string. So changing from "myData" to "{myData}".

Incorrect code:

XML:
  1.     <fx:Declarations>
  2.  
  3. <s:ArrayCollection id="myData">
  4. <s:source>
  5. <fx:Object label="Engineering" data="ENG"/>
  6. <fx:Object label="Product Management" data="PM"/>
  7. <fx:Object label="Marketing" data="MKT"/>
  8. </s:source>
  9. </s:ArrayCollection>
  10. </fx:Declarations>
  11.  
  12. <s:List dataProvider="myData" x="10" y="10" width="575" height="297" skinClass="ActivityStreamSkin"></s:List>

Solution

XML:
  1. <s:List dataProvider="{myData}" x="10" y="10"  width="575" height="297"  skinClass="ActivityStreamSkin"></s:List>

Please post your comments to help future visitors.

No comments yet. Be the first.

Leave a reply

Wrap MXML and ActionScript in [xml] [/xml] and [as] [/as] tags respectively