2 Replies Latest reply on Nov 28, 2008 12:04 AM by Madhav Subedi

    Array Collection  1 Row

    MrFork Level 1
      Hello all,

      I'm reading in an XML data source into flex using PHP which is working great, the data is then fed into Flex and stored into an array collection. However, when the XML only has one data item I get this error message.

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

      Im assuming that an Array collection must have more than one data item for it to work.

      Any ideas on how I get around this?

      Thanks

      Craig
        • 1. Re: Array Collection  1 Row
          Level 7

          "MrFork" <webforumsuser@macromedia.com> wrote in message
          news:gglndr$bl4$1@forums.macromedia.com...
          > Hello all,
          >
          > I'm reading in an XML data source into flex using PHP which is working
          > great,
          > the data is then fed into Flex and stored into an array collection.
          > However,
          > when the XML only has one data item I get this error message.
          >
          > Error #1034: Type Coercion failed: cannot convert
          > mx.utils::ObjectProxy@1e67efb9 to mx.collections.ArrayCollection.
          >
          > Im assuming that an Array collection must have more than one data item for
          > it
          > to work.
          >
          > Any ideas on how I get around this?

          Is there any reason you're not using an XMLListCollection? Why strip out
          all your e4x functionality?


          • 2. Array Collection  1 Row
            Madhav Subedi Level 4
            MrFork,

            I also faced similar problem. i dont know if it helps you, i hope it does.
            i used server side trick to solve it, created a <count></count> tag in my xml, which holds the no. of records.
            and in flex result listener, created my arraycollection like this: