Question

My index.php file loads the Facebook JavaScript SDK and the FBJS bridge:

<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" src="FBJSBridge.js"></script>

It then inits the Facebook SDK:

<script type="text/javascript">
   FB.init({
     appId  : '<?=$fbconfig['appid']?>',
     session: <?php echo json_encode($session); ?>,
     status : true, // check login status
     cookie : true, // enable cookies to allow the server to access the session
     xfbml  : true  // parse XFBML
   });

And embeds the Flash file using swfobject:

swfobject.embedSWF("http://www.myserver.org/Facebook/app/app.swf", "holderDiv", "740", "616");

When I run this file on my server, I can communicate with Facebooks JavaScript SDK either indirectly through ExternalInterface calls, launching various Facebook UI dialogs etc. And I can also use the facebook-actionscript-api to launch the same dialogs directly from ActionScript.

When I however use this index file as my Facebook canvas url and load the swf in a Facebook iFrame, the communication crashes the application. I'm not sure how to debug this but I think it might have to do with crossdomain security. Any ideas on debugging and/or solutions are welcome.

Was it helpful?

Solution

The FBJSBridge.js has been replaced in the updated 1.5 of the API. It's now in the AS3 source.

OTHER TIPS

It seems adding the parameter allowScriptAccess: "always" did the trick. Strange this isn't mentioned in sample code applications ...

here u can find a tutorial with source coad === Communacation with Flash and javascript

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top