Today i'm working on a new Adobe flash builder 4.5 mobile and facebook application. to minimize my task i googled for facebook actionscript api and found a good actionscritpt opensource resource in google codes. so i'm shearing it here in my blog. Google code page here
Frends List Example
package {
import com.facebook.graph.FacebookDesktop;
import com.facebook.graph.net.FacebookRequest;
import flash.events.EventDispatcher;
import mx.collections.ArrayList;
public class FriendsModel extends EventDispatcher {
protected var friendsHash:Object;
protected var friendsArrayList:ArrayList;
public function FriendsModel() {
super();
friendsHash = {};
friendsArrayList = new ArrayList();
}
public function get dataProvider():ArrayList {
return friendsArrayList;
}
public function load():void {
FacebookDesktop.api('/me/friends', handleFriendsLoad);
}
protected function handleFriendsLoad(response:Object, fail:Object):void {
friendsArrayList.removeAll();
if (fail) { return }
var friendsIds:Array = [];
var friends:Array = response as Array;
var l:uint=friends.length;
for (var i:uint=0;i
0 comments:
Post a Comment