Need to Load facebook ID vars into Flash using only client side scripting -
- I would just like to display the user's name and photo within a flash app.
- I hope that it will only be done in the client without using any backend scripting.
- ActionScript 3 for Facebook Facebook is under construction for the next few weeks to comply with the new 3D requirements of SDK, so I do not believe being current can be useful.
We searched for and tested for a week with any luck and I feel that the answer is either very simple or not possible.
If you have a solution, please help please
It seems that getting the current javascript via SDK and getting those items through their external interface, the SDF
is an example. (Make sure your SDF id is "Flash OBJ")
Javascript code:
& lt; Script type = "text / javascript" & gt; Window.fbAsyncInit = function () {FB.init ({appId: '
; status: incorrect, cookie: true, xfbml: false}); }; (Function () {var e = document.createElement ('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document .getElementById ('FB-root'). AppendChild (e);} ()); Function connect user () {fbp ('/ m', function) {var usrs = new array (); usrs.push (feedback); document getElementById ('Flash oz'). LoadUser (usrs);}) ; }; Function Request Login () {FB Login {If (Response Session) {If (Response). {Document.getElementById ('Flash Obsessive'). OnLogin ();} Other {// User is logged in , But no permission granted}} and {// user is not logged in}}, {perms: 'email, user_birthday'}); } & Lt; / Script & gt; and then in AS3:
public function FBconnect (): zero {ExternalInterface.addClallback ("onlin", onlin); ExternalInterface.call ("requestLogin"); } Private Function Online (): Zero {trace ("FB login"); ConnectUser (); } Private Function connectUser (): Zero {ExternalInterface.addClallback ("loadUser", userCallback); ExternalInterface.call ("connectUser"); } Private function user callback (data: array): zero {trace ("FB user load"); Var userData: object = data [0]; TraceObject (UserData); _FBuser = New FBUser (userData.id); _FBuser.firstName = userData.first_name; _FBuser.lastName = userData.last_name; Var d: date = new date (string (userData.birthday)); _FBuser.birthDate = D; _FBuser.gender = userData.gender; _FBuser.email = userData.email; Dispatches (new event (event .complete)); }
Comments
Post a Comment