Forum ‹ ActionScript 3.0 ‹ Adobe AS3 SDK for Facebook: external web apps with no JS?
11 posts
• Page 1 of 1
Adobe AS3 SDK for Facebook: external web apps with no JS?
I am using the official "Adobe AS3 SDK for Facebook platform" libraries to connect my game to facebook.
In the libraries, you have two options for connecting to facebook, via the Facebook.as, and the FacebookDesktop.as.
The Facebook.as is meant for Facebook Canvas and Web deployment, and it assumes the Facebook Javascript to be embedded in the page that has your .SWF.
However as we all know, games are frequently redistributed, just by taking the .SWF and posting it elsewhere, where most likely it wont have the Facebook Javascript embedded in the page.
My question is, that in these situations, is it a good idea to use the FacebookDesktop.as instead? IE detect the URL, and if we are on 3rd party Website, then use the FacebookDesktop.init() etc methods instead of the Facebook.init() ones?
What do you think? Are there any big disadvantages or a better way of doing it?
In the libraries, you have two options for connecting to facebook, via the Facebook.as, and the FacebookDesktop.as.
The Facebook.as is meant for Facebook Canvas and Web deployment, and it assumes the Facebook Javascript to be embedded in the page that has your .SWF.
However as we all know, games are frequently redistributed, just by taking the .SWF and posting it elsewhere, where most likely it wont have the Facebook Javascript embedded in the page.
My question is, that in these situations, is it a good idea to use the FacebookDesktop.as instead? IE detect the URL, and if we are on 3rd party Website, then use the FacebookDesktop.init() etc methods instead of the Facebook.init() ones?
What do you think? Are there any big disadvantages or a better way of doing it?
Last edited by mrgreen on April 14th, 2011, 8:34 pm, edited 1 time in total.
- mrgreen
- Posts: 52
- Joined: February 12th, 2011, 7:27 pm
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
Problem is that there are a lot more resources/forums/tutorials for the official Adobe version, and over time i suspect I would need to switch over to that one.
But then it looks like there is no way of Authing the application on a 3rd party website with what Adobe managed to put out, and that is where your version beats Adobe!
I cant believe how stupid Adobe is to have done it this way. i mean 99% of all games are on 3rd party websites... anyway
Can I ask for a big favour
? I would like to have the best of both worlds, to port/reuse the auth method that is used in your version and use that as a gateway for the rest of Adobe's SDK?
Can you give me some guideance how I could achieve that?
But then it looks like there is no way of Authing the application on a 3rd party website with what Adobe managed to put out, and that is where your version beats Adobe!
I cant believe how stupid Adobe is to have done it this way. i mean 99% of all games are on 3rd party websites... anyway
Can I ask for a big favour
Can you give me some guideance how I could achieve that?
- mrgreen
- Posts: 52
- Joined: February 12th, 2011, 7:27 pm
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
The init() method in the Adobe Facebook SDK takes an access token as a parameter. And there you go.
-

Henrik - .IO
- Posts: 570
- Joined: January 4th, 2010, 1:53 pm
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
Henrik wrote:The init() method in the Adobe Facebook SDK takes an access token as a parameter. And there you go.
As Henrik said, the callback of facebookOAuthConnectPopup provides all the information you need to do an AUTH with the official AS3 API.
At this point I would also like to point out that our AS3 API is a direct port of the Facebook JS API which means that it's quite a lot better documented than the actually official AS3 API
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
Thanks guys, but one last question 
The popop window that the facebookOAuthConnectPopup generates, I think takes you to facebook where you log on, and then back to a playerIO page( fb.playerio.com/fb/_fb_quickconnect_oauth_receive ) ? Does this html page have the Facebook Javascript that the Game will use to communicate with?
Or how does it work when the game makes calls to the javascript later on?
The popop window that the facebookOAuthConnectPopup generates, I think takes you to facebook where you log on, and then back to a playerIO page( fb.playerio.com/fb/_fb_quickconnect_oauth_receive ) ? Does this html page have the Facebook Javascript that the Game will use to communicate with?
Or how does it work when the game makes calls to the javascript later on?
- mrgreen
- Posts: 52
- Joined: February 12th, 2011, 7:27 pm
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
mrgreen wrote:Thanks guys, but one last question
The popop window that the facebookOAuthConnectPopup generates, I think takes you to facebook where you log on, and then back to a playerIO page( fb.playerio.com/fb/_fb_quickconnect_oauth_receive ) ? Does this html page have the Facebook Javascript that the Game will use to communicate with?
Or how does it work when the game makes calls to the javascript later on?
Using our popup method will not give you any access to any Javascript methods etc. What you get back is a valid Facebook token which you can then use to initialize whatever API you wish.
If you wish to use a none Player.IO powered API you need to research yourself how to use it.
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
My question applied to the PlayerIO Facebook SDK!
In your FB.as, you do use methods that make calls to the ExternalInterface ? I was asking how does that work? Does it interact with the Javascript on the "fb.playerio.com/fb/_fb_quickconnect_oauth_receive" page? what does that page do anyway?
In your FB.as, you do use methods that make calls to the ExternalInterface ? I was asking how does that work? Does it interact with the Javascript on the "fb.playerio.com/fb/_fb_quickconnect_oauth_receive" page? what does that page do anyway?
- mrgreen
- Posts: 52
- Joined: February 12th, 2011, 7:27 pm
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
mrgreen wrote:My question applied to the PlayerIO Facebook SDK!
In your FB.as, you do use methods that make calls to the ExternalInterface ? I was asking how does that work? Does it interact with the Javascript on the "fb.playerio.com/fb/_fb_quickconnect_oauth_receive" page? what does that page do anyway?
For the methods that require FB.js you need to embed the game on a site that has the FB.js file embedded and ExternalInterface enabled. There is no way around this no matter what you do. This applies to our API and the official Adobe API as well.
Basically if you want to spawn a js share popup you need access to javascript etc.
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
Just trying to figure out how "standalone" the application can be? You know that Flash games are usually re-distributed, where 99% of the time the Facebook JS isnt present.
Do you have a list of things that require the Facebook JS in the html page? like i suppose all calls to the UI, but what about basic stuff ?
Would you say that your implementation of the Facebook SDK is more standalone than the Adobe SDK? ( apart from what I already know the logging on )
Do you have a list of things that require the Facebook JS in the html page? like i suppose all calls to the UI, but what about basic stuff ?
Would you say that your implementation of the Facebook SDK is more standalone than the Adobe SDK? ( apart from what I already know the logging on )
- mrgreen
- Posts: 52
- Joined: February 12th, 2011, 7:27 pm
Re: Adobe AS3 SDK for Facebook: external web apps with no JS?
The API documentation on https://github.com/playerio/Facebook-Graph-As3 literally states what methods are support without the FB.js and which are not.
As in which is better I will leave up to you to decide, it all comes down to your needs and wants.
As in which is better I will leave up to you to decide, it all comes down to your needs and wants.
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
11 posts
• Page 1 of 1