2 Replies Latest reply on May 1, 2013 4:03 PM by John Hall

    New arrayCollection not by reference

    John Hall Level 4

      I know I can make a copy of an ArrayCollection with ObjectUtil.copy  or  writing byte array and registering the type. But what happens if you take the source of an existing ArrayCollection, the Array itself, and create a new array? Is it unreferenced to the original ArrayCollection.

       

      In code,

       

      var myArrayCollection:ArrayCollection. // passed in value

      var myNewArrayCollection = new ArrayCollection(myArrayCollection.source);

       

      Is my original arrayCollection still affected by changes in myNewArrayCollection, like using filterfunctions?