2 Replies Latest reply on Nov 12, 2009 3:46 AM by littlebridge

    RemoteObject arrays allocates same memory

    littlebridge

      When I receive remote data, if the arrays are identical it allocated the same storage to the two arrays:

       

      I have a AS3 remote object eg:

       

      Snippet:

       

          [RemoteClass(alias="TestVO")]
          public class TestVO

           {

                public var test1:Array;

                public var test2:Array;

           }

       

      When I receive remote data, if the array data are identical it allocated the same storage to the two arrays.

       

      Eg: From remote server (PHP / ZendAMF) I send:

       

      $this->test1 = array("foo", "bar");

      $this->test2 = array("foo", "bar");

       

      When I debug the TestVO object in Flex debugger I get (for example):

       

      test1     Array(@597d779)

      test2     Array(@597d779)

       

      ie: they reference the same memory, which obviously causes problems.

       

      If I send from remote server slightly different values:

       

      $this->test1 = array("foo", "bar");

      $this->test2 = array("bar", "foo");

       

      In the Flex debugger I get two arrays as you'd expect:

       

      test1     Array(@54cb7e9)

      test2     Array(@54cb741)

       

      Remote object mappings work all Ok, just it seems arrays with duplicate data.  I haven't yet tried 2 objects with identical property values...


      Anyone know why this is?

       

      Thanks.