3 Replies Latest reply on May 25, 2010 7:02 AM by PegLeg7

    Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@61bee51 to mx.collections.A

    PegLeg7

      I have this very simple code to try and verify that I have a connection.  I am trying to read an xml file but I keep getting:

       

      Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@61bee51 to mx.collections.ArrayCollection.

       

      if anyone can look at the code below and give me some ideas or links to the answer I would greatly appriciate it.  I have also include the xml file at the bottom.  Not very big.

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application

       

       

      xmlns:mx="

      http://www.adobe.com/2006/mxml"

      layout="

      absolute"

      creationComplete="requestTIP.send()"

      >

       

       

       

      <mx:Script>

      <![CDATA[

       

       

      import mx.rpc.events.FaultEvent;

       

      import mx.rpc.events.ResultEvent;

       

      import mx.collections.ArrayCollection;

       

      import mx.controls.Alert;

       

      [

      Bindable]

       

      private var proid:ArrayCollection;

       

       

      private function resultHandler(event:ResultEvent):void {

      proid = event.result.root.data;

      }

       

       

      private function faultHandler(event:FaultEvent):void {

      Alert.show(event.fault.message);

      }

      ]]>

       

      </mx:Script>

      <mx:HTTPService id="requestTIP"

      url="

      assets/testID.xml"

      result="resultHandler(event)"

      fault="faultHandler(event)"

      />

       

       

       

      <mx:DataGrid id="dg" dataProvider="{proid}"/>

      </mx:Application>

       

      <?xml version="1.0" encoding="ISO-8859-1" ?>

      <root>

      <data>

      <Project_ID>01-00-0037</Project_ID>

      <Programming_Agency>IDOT Office of Planning & Programming</Programming_Agency>

      <Abbrev_Location>VARIOUS LOCATIONS-CHICAGO EXPY FROM CHICAGO EXPY GATEWAY BEAUTIFICATION</Abbrev_Location>

      <All_Work_Types>Conduct Landscaping</All_Work_Types>

      <Council>CITY OF CHICAGO</Council>

      <Federal_Cost />

      <Total_Project_Cost />

      <Total_Cost />

      <Total_with_Illustrative>2510000</Total_with_Illustrative>

      <MYBonly>Identified - In TIP</MYBonly>

      <Modeled>No</Modeled>

      <Completion>Not Determined</Completion>

      <Last_Updated>3/31/2010 4:35:26 PM</Last_Updated>

      <Overall_Type>Other</Overall_Type>

      <Contact>Tim Milam</Contact>

      <Contact_At>tim.milam@illinois.gov</Contact_At>

      <Recovery>0</Recovery>

      </data>

      <messages>

      <message>1 matching rows found</message>

      </messages>

      <errors>

      <error />

      </errors>

      </root>

       

      thanks

       

      Richard Krell