douglashowe / as3flickrlib

Automatically exported from code.google.com/p/as3flickrlib
0 stars 0 forks source link

FlickrResultEvent.data improperbly organized #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
From the Docs on the photosetsGetList Event. (Dispatched after calling 
serviceName.photosets.GetList())

"Broadcast as a result of the getList method being called The event 
contains the following properties success - Boolean indicating if the call 
was successful or not data - When success is true, an Array of PhotoSet 
instnaces When success is false, contains an "error" FlickrError instance"

However the Event.data object doesn't corectly hold an array with PhotoSet 
instances. Instead it holds an object instance. 

In order to get to the array you have to access the object with the 
correct property name which isn't defined anywhere. In the case of getList 
the propertyname is "photoSets". I spent a few hours debugging this.

My eventhandler:
protected function getSets(fre:FlickrResultEvent)
{
    var sets:Array;
    if(fre.success)
    {
        // Right
        sets = fre.data["photoSets"];
        //Wrong
        // sets = fre.data;
    }
}

Why the need to nest the data in an objectproperty? It makes no sens to 
me? I changed the my MethodGroupHandler like this:

Line 149:   //result.data = rsp.data;
Line 150:   result.data = rsp.data[propertyName];

Original issue reported on code.google.com by lega...@gmail.com on 22 Mar 2008 at 1:06