2 Replies Latest reply on Jul 22, 2009 11:54 PM by Benoitcn

    How can represent this data in AS3

    Benoitcn Level 1

      I try declare a ArrayCollection like this

       

      var arr:ArrayCollection = new ArrayCollection(

      [{group:"Group One", members:["Jonny", "Tommy", "Lucy"]}, etc..]);

       

      I can't declare that using static sentence.

      So I do it like this:

       

      var dpArr:ArrayCollection = new ArrayCollection();

       

      for (var i:int = 1; i < 10; i++)

      {

      var obj:Object = new Object();

      obj.group = "Group One";

      obj.members = innerArr;

      dpArr.addItem(obj);

      }