Embedding Adobe Flash

Problem

I’ve made the most brilliant Adobe Flash piece ever created, and now I want to stick it in my FBML.

Solution

Use the fb:swf tag to embed Flash. The simplest form is:

<fb:swf swfsrc="http://www.youtube.com/v/12345"/>

Discussion

The FBML parser will automatically add a few Flash variables to your embed that you can then use in your Flash movie (these are similar to the parameters added by the fb:iframe tag—see Embedding an iFrame), shown in Table 6-6.

Table 6-6. Flashvars added by the FBML parser

Name

Type

Description

allowScriptAccess

string

This parameter is always set to “never” by Facebook, so that your embedded Flash movies can’t access any page-level scripts.

fb_sig_profile

int

If this Flash is being loaded in a Profile, this is the uid of the Profile owner. If it’s being loaded in a Canvas page, this will be blank.

fb_sig_time

int

A timestamp of when this signature information was generated.

fb_sig_user

int

The uid of the current user (a.k.a. loggedinuser).

fb_sig_session_key

string

The current Facebook session key.

fb_sig_expires

int

The session expiration time.

fb_sig_api_key

string

Your application’s API key, which the Flash movie will need if it’s going to make any API requests.

fb_sig_added

bool

Indicates whether the current user has added your application.

fb_sig

string

An MD5 hash of all the parameters with names that start with fb_sig_ plus your application’s secret key. See Enhancing security in your Flash later in this recipe for how to use this to enhance ...

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.