Embedding flash object in Facebook Apps (FBML)

Yesterday I was trying to include a flash object in a facebook app using FBML fb:swf tag. The flash object needed to change the url of the page it was running on on a particular event. But since facebook prevents direct script access from flash, this could not be done.

Here is a simple workaround:

1. Create a simple html page containing only the flash object that you want to include.

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   	<object type="application/x-shockwave-flash" data="foo.swf" width="300" height="300">
   		<param name="movie" value="foo.swf">
         	<param name="quality" value="high">
         	<param name="scale" value="noscale">
         	<param name="salign" value="LT">
         	<param name="menu" value="false">

2. Embed this html on the facebook page using the fb:iframe tag.

Now you can make all the Actionscript calls you want to. Only caveat to this approach is that you will no longer be able to make Facebook API calls directly from flash.

This entry was posted in Codeprix and tagged , , , , . Bookmark the permalink.

15 Responses to Embedding flash object in Facebook Apps (FBML)

  1. tvance says:

    Thank you thank you thank you!!! I could not figure out how to get Amazon widgets into my php page and you solved my problem!

  2. Andry Fixa says:

    thanks, you give me an idea with different way. cause not works for me

  3. Shira says:

    Hey, I realize this post is dated a year ago but I was wondering if you see this comment if you can please answer some of my questions regarding this post. I hope to hear from you, thanks!

    - S

  4. Shira says:

    where would I create a simple html page with the flash object I want to include?

  5. lee-ann says:

    Hi I need help I want to put this on a Static FBML page on my facebook PAGE

    How do i do it ???

  6. anand says:

    You can use the Static FBML app for including it on your facebook page.

  7. thanks for sharing. I’m trying to figure out how to add a like button in my .swf, at the time it’s more complex than I was expecting.

  8. Nil says:

    Is it possible for you to point to an example “flash-object only” page to check if that works for me? Before I will start creating a page like this. Also: fb:frame needs to be inserted into a new tab created with static fbml?

  9. Gad says:

    Could you please help me add Amazon widget to an FBML Static tab on facebook? I followed your instructions but it didn’t help…

  10. TillmanZ says:

    Hi there,

    I am trying to post a swf audio player to a facebook wall using the FB C# API. I can populate the link and the source properties but I simply fail to accomplish anything that remotely works. Obviously I can include direct links to .mp3 files but as soon as I want to add more info – like parameters needed for my swf file for example – facebook respondes with error 400.
    So what’s the recommended approach for posting an swf object and including the necessary parameters?
    Thanks for ANY sort of info! :-)

  11. kamal says:


    i would like to add my website on xml flash fbml on my fan page facebook and i need the code for that if possible

    thank you

  12. aaron says:

    Do I need to host my html file with the flash object?

    I have this code.


    this code was made by publishing the flash file.
    please help. email me niceonedong@yahoo.com. thanks in advance.

  13. salih says:

    can you put sample swf on facebook this is my swf path