Posted by & filed under flash, flex.

I always thought that arraycollection were only accessible within Flex. Last week however I needed to access some complex data from a webservice in flash. To access the webservice I used a very handy flash extension, which provided the remoting classes from Flex into flash. The result however contained a ArrayCollections. Luckily I found out that is was perfectly possible to parse the data from the arraycollections into arrays and object. I knew that the result had to contain a Clips Array within each Chapter as you can see in the debugger screenshot. Now in flash I could access these Clips like this

var _chapters_ar:Array = _chapters.list.source;

for( var i:int = 0; i < _chapters_ar.length; i++ )
{
     var _clips_ar:Array =  _chapters_ar[i].Clips.list.source;

     for (var j:int = 0; j < _clips_ar.length; j++)
     {
        ...
}

see screenshot below

debug view in flash

Comments are closed.