문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top