I tend to use the Array Utils...

var myArrColl:ArrayCollection;
myArrColl = new ArrayCollection(ArrayUtil.toArray(event.result));



--- In [email protected], "azona26" <azsl1326-em...@...> wrote:
>
> I am using amfphp to return a complex object / multi-dimensional array.
> In the past, I have been able to simply create an ArrayCollection of the
> returned results by doing the following:
> public function result(event:ResultEvent):void {
> var resources_ac:ArrayCollection = new ArrayCollection()
> resources_ac = event.result as ArrayCollection
> }
> In this particular case, if I try this method, the ArrayCollection does
> not contain any items. In order to create the ArrayCollection, I have
> done the following:
> 
> var resources_arr:Array = new Array()
> for(var i:String in event.result) {
>                  event.result[i] = new ObjectProxy(event.result[i]);
>                  resources_arr.push(event.result[i])
>              }
> 
>              resources_ac.source = resources_arr;
> I am guessing it has to do with the fact that the returned item is a
> multi-dimensional array/complex object? While this method seems to work
> fine, is it the best/proper way to handle this type of returned data?
> 
> Thanks for the insight.
>


Reply via email to