![]()
0.7
FacebookBridge is freely available. If you find this class useful, we invite you to check out our other components for Flash here.
Download Class
This bridge is used to communicate the facebook javascript bridge with your AS project. This means that the application will only work with iframe based applications. The container html must contain the following:
The html must be xhtml and may optionally include the fbml namespace if you wish to include XFBML tags:
The facebook api bridge:
A means to embed include the swf, like the swfObject:
A div tag to embed the swf
A call to initialize the API
- In the init call, make sure you fill in your api key and have a relative route to the cross domain receiver file.
- You should pass via flash vars the name of the tag that contains your swf.
The bridge allows you to call any method of the facebook api. For a list and description of incoming parameters and result datasets, please read the Facebook API documentation available here. The following are the steps to use the class:
This object receives the reference to the flash div passed via flashvars above.
- The name of the Method (eg. "Photos.getAlbums")
- The parameter(s) as an Object (eg. {uid: fb.uid}
- The reference to the callback function that will be called when the result arrives. (eg. onFacebookAlbums).
Please note that the facebook js bridge implementation fills some of the required fields for you so you do not have to include the following parameters: api_key, call_id, sig, v. Just include the parameters pertinent to the method you wish to invoke as per the Facebook API documentation available here.
The function declaration must include two parameters, a FacebookCall and a FacebookResponse. The call is a reference to the original call and the response contains the result of the query.
The response includes a success property that indicates if the call was successful or not. If the call was unsuccessful the result property becomes null. On the other hand if the request was ok, the exception property becomes null.
The result property contains the data from the query. The data usually comes in the form of an Array of objects as per the Facebook API documentation available here.

FacebookBridge AS3 by Zerofractal Studio is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License