0

您好,我的项目中有一个数据网格,但出现以下错误:

warning: unable to bind to property 'name' on class 'Array' (class is not an IEventDispatcher)

这是我分配数据的地方:

var myarr:Array = [];
packageData = packageData=SharedObject.getLocal("local_data");
for (var packageId:String in packageData.data.packages) {
    myarr.push(packageData.data.packages[packageId])
}

cur_uploads = new ArrayCollection(myarr);
dg_uploads.dataProvider = cur_uploads;

我读过我应该使用 aproxyObject但我无法将 my 转换ArrayObject. 那么有没有其他解决方案来摆脱错误?

4

1 回答 1

0

这是我所做的:

   var arrayCollection:ArrayCollection = new ArrayCollection();
   packageData = SharedObject.getLocal("local_data");

   for (var packageId:String in packageData.data.packages) {
       arrayCollection.addItem(new ObjectProxy(
            packageData.data.packages[packageId]
       ));
   }

   dg_uploads.dataProvider = arrayCollection;
于 2012-05-30T13:09:53.783 回答