3 Replies Latest reply on Feb 10, 2014 4:21 AM by Craberoid

    assigning messageField property on IconItemRenderer using actionscript

    sumit.king7 Level 1

      I want to assign message field property of IconItemRenderer using actionscript. Initially i did:

       

      <s:List id="numberList" width="100%">

           <s:itemRenderer>

                <fx:Component>

                     <itemrenderers:IconItemRenderer messageField="number" labelField="label"/>

                </fx:Component>

           </s:itemRenderer>

      </s:List>

       

      When I tried to set messageField using actionscript like this:

       

      (numberList.itemRenderer as IconItemRenderer).messageField = "url";

       

      this gave me null exception.

       

      What I think here is, itemRenderer property of List provides a Class type instance which can not be typecast into IconItemRenderer. So what is the solution for this.