1 Reply Latest reply on Apr 29, 2010 11:15 PM by jfillman

    Data Type Between ArrayCollections

    jfillman Level 1

      I have object in my ArrayCollection that stores date as a number like this:



      D: 89012, Height: 50, Label: "Test # 1", Group: 0, Date: 1270450800000}


      I routinely pass an array item Object from one ArrayCollection to another (myACTwo.addItem(myACOne[4])), and as long as both ArrayCollections are within the same MXML file, the date field is passed correctly or if the data is being passed up to a parent, it also works: parentApp["myACTwo"].addItem(mySubAC[4]).


      However, if I'm passing the object from one MXML file down to an ArrayCollection in another file, I cannot seem to pass an individual Object without the Date field value changing. I'm passing the object as follows:


      myComponent.myACOne.addItem(myParentAC[4])). What happens is that the numerical date value of 1270450800000 gets translated into

      1272522491208, a completely different date. It actually is always changing it to the value for the current date and time, not a random date and time.


      I've also tried:


      var myObject:Object = myParentAC[4];



      with the same result.


      If I pass the entire array like this:


      myComponent.myACOne.source = myParentAC.source


      then then entire array is passed correctly, but I need to pass individual items, not the entire array.


      myComponent.myACOne.addAll(myParentAC) also causes the date to change.