Pergunta

I've developed a Flash game that I'm trying to put on Facebook. It's out there as a soft release, and we've encountered some major problems.

I'm using the AS3 Facebook API. Unfortunately, this results in a pop-up for the FB authentication, which my team lead doesn't like. We're also having re-login issues when the user refreshes the page.

I found an example of an in-window authentication, but it uses the Javascript API. I have very little JS experience, so I'm hoping you guys can answer a few questions.

1) After authentication, how do I tell JS to play my swf? Should the swf be in a different URL?

2) Can I access Javascript from my Flash file (AS3)? I have a button in my game that allows the user to invite friends to play, and it pulls info from the FB friends list.

3) If I use the AS3 API for the "invite friends" function, will mixing the JS API and the AS3 API cause problems?

Foi útil?

Solução

for question 2 you need to try this one

ExternalInterface.call("JavaScriptFunctionName");

for question 3:

use this on my blog with code.

http://alvijee.blogspot.com/2011/01/flex-facebook-calling-friendliest-and.html

Outras dicas

  1. You can also use ExternalInterface to recieve a method call from the JS auth callback, its provides 2-way communication between javascript and flash. You'll need to embed with swfObject2.js

  2. As above

  3. The as3 graph api is dependant on the JS sdk. So there should be no conflict.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top