如何创建可以生成唯一变量名的新数组?
像:
AC+nu as in AC1:ArrayCollection
AC+nu as in AC2:ArrayCollection
AC+nu as in AC3:ArrayCollection
AC+nu as in AC4:ArrayCollection
nu++;
答案 0 :(得分:0)
我想你想要:
var ac1:ArrayCollection = new ArrayCollection(sourceArrayCollection.list);
var ac2:ArrayCollection = new ArrayCollection(sourceArrayCollection.list);
答案 1 :(得分:0)
您是否会考虑使用超级ArrayCollection来存储您拥有的所有ArrayCollection。理想就像一个二维数组。
var superDataCollection:ArrayCollection = new ArrayCollection();
var dc:ArrayCollection = new ArrayCollection();
var di:Object = new Object();
di.label1 = "Test";
di.label2 = "Test2";
dc.addItem(di);
superDataCollection.addItem(dc);
myDG.dataProvider = superDataCollection[0];