3 Replies Latest reply on Jun 15, 2009 10:08 PM by leybniz

    Typecasting to custom object not working

    sreenath205

      Hi All,

       

      I am new to flex and i am stuck with this problem.

       

      I have a combobox with some custom objects added to it say of type xyz.When i try to get the array out of this combox using the following code

      var Arr:Array = cmbItem.dataProvider.toArray();

       

      the result returned is correct,but when i try to iterate over the array and get a element out it and try to assign it to "xyz" object it is returning null!!

      var temp:XYZ = arr[0] as XYZ;

       

      temp is always null.

      Any pointers appreciated.

       

      Thanks

      -sreenath