I am an ActionScript developer and I am working on an interactive SWF that gets loaded by Drupal. I am using SWFObject 2.2, the Facebook API for Actionscript, and the SWF Tools module for Drupal.
The purpose is to allow the user to create a picture and then post it to thier newsfeed. The interaction with Facebook works great when I load it into a static html page using swfobject.embedSWF(), but when Drup开发者_JAVA技巧al loads it (via SWF Tools) the swf loads but the Facebook methods do not work. For example, Facebook.init(APP_ID, onInit) never returns. Normally Facebook.init(APP_ID, onInit) will return a success object if the user is already logged in, or a fail object if the user is not. When my swf is loaded by Drupal this does not work.
I've triple checked the SWF Tools configuration, and as I said, the swf loads and works, but just can't contact Facebook.
Has anyone been able to make this combination (Drupal / Flash / Facebook) work?
Is your Flash movie is served inside example.com, and your Drupal site is also in example.com?
Drupal has an .htaccess file in the Drupal root that redirects all requests to index.php.
If you are trying to call any function inside Drupal from within Drupal you will need to create your own module and register a custom menu callback, then call that call back from your Flash movie.
Your custom module would then contact Facebook on behalf of your Flash movie. I've done communication between Flash and Drupal, so it's possible, as long as you register those callbacks.
For a walk-through of the menu system visit this page.
This page should help you with writing the module.
精彩评论