Talk:Fb:swf

From Facebook Developer Wiki

Jump to: navigation, search

Contents

[edit] Incorrect fb_sig hash

The fb_sig hash passed by Facebook in flashVars does not match the MD5 of the other fb_sig_* variables. Something is wrong with the fb_sig recipe on fb:swf, and this needs to be fixed to allow Flash apps to interface with Facebook securely.

Using fb:swf, my Flash asset is receiving the following flashVars from Facebook:

fb_sig_added fb_sig_api_key fb_sig_expires fb_sig_profile_update_time fb_sig_session_key fb_sig_time fb_sig_user

...plus an fb_sig.

I pass all these from Flash to my server, where I create a string that looks like this:

added=1api_key=xxxxxxxxxxxxxxxxxxxxxxxxxexpires=0profile_update_time=1210011917session_key=24a3b5bc9aa72bb494eb785b-xxxxxxxtime=1211875218.6634user=xxxxxxxAPPSECRET

Then I take the MD5 hash of that, and it doesn't match the fb_sig given by Facebook. The variable names and/or values sent by Facebook are not the same set as those used to create the MD5 hash.

Other users have reported trouble as well: http://forum.developers.facebook.com/viewtopic.php?id=772

Please verify this and let us know when we can expect a fix. Thanks!


[edit] If the Video Doesn't Show On a Profile Page

Check out this thread: http://forum.developers.facebook.com/viewtopic.php?pid=31428

IMHO this info (about how you must use imgsrc) should be front-and-center on the article page for fb:swf...

--717295711 21:13, 3 January 2008 (PST)


[edit] Plans for Director / Shockwave .DCR support?

Currently it appears impossible to embed .dcr files except via an iframe. Thus, no .dcr's can be placed on profile pages. As a Shockwave developer this is very disappointing. Is .dcr support planned? Something like an <fb:dcr> tag? Shockwave is still in widespread use mainly due to it's extensive 3D capability that Flash does not support. PS, The 'book's API is quite phenomenal--congratulations.


[edit] Image Is Presented First

Is there a size that we need to keep this image under? And Why is it than when you change the image, the page will load old image? I have changed the location of the image but it keeps loading the old image (I deleted it of my server)! Does facebook store the image's on there server to load faster and if so how do we get rid of them?

To answer the question above about old images not removing. Facebook caches the image. You need to call refresh methods so that Facebook fetches a new one. ( I also think that Facebook only grabs them after some time period after the refresh is called) check out http://wiki.developers.facebook.com/index.php/Fb:ref


[edit] embed params

Does anyone know how to use "salign" exactly and which parameters it has ? Thanks!

[edit] wmode facts

I removed this sentence: The flash parameter wmode is set to transparent, which causes extensive problems under Firefox. According to Adobe, Firefox does not support wmode. I could not find such evidence on Adobe's website; in fact, this page specifically says that the following are supported:

  • Internet Explorer 3 or higher (Windows)
  • Internet Explorer 5.1* and 5.2* (Macintosh)
  • Netscape 7.0*
  • Mozilla 1.0 or higher*
  • AOL*
  • CompuServe*

Firefox uses the same rendering engine as Mozilla, so the original statement seems quite moot. Paul Borokhov 14:06, 2 August 2007 (PDT)


Hi Paul,

I have been trying to use a flash application that uses keyboard input. Unfortunately, when the wmode parameter is set to anything other than 'window' under Firefox, the Key.isDown function always returns false which makes it difficult (though not impossible) to get keyboard input.

This blog explains the problem: [1]

And this page has an example of the problem [2]

Is there a reason for the wmode to be set to transparent by default? Is it possible to get the wmode parameter in the <fb:swf> to be optional?

Cheers, --522652577 22:44, 11 August 2007 (PDT)

I would like to second the request for a wmode option. My flash contains MovieClips which the user can drag around the screen. With wmode=transparent I get a bug where sometimes the MovieClips become partially cropped while dragging. If I change wmode to window (without changing anything else at all) then the bug is gone. This occurs on Firefox and Internet Explorer.

An option for wmode would solve my problem. --626663746 22:47, 19 September 2007 (PDT)


[edit] waitforclick="false"

I could not get the waitforclick to work any advice

<fb:swf waitforclick="false" swfsrc="URL" width="605" height="491"> </fb:swf>

waitforclick should work on canvas pages, but it doesn't for profile pages.--506843584 20:36, 15 August 2007 (PDT)


Hi, I was under the impression that waitforclick will work for profile pages. "false does not work in profiles for security and aesthetic reasons, except after an Ajax call." Reference: http://wiki.developers.facebook.com/index.php/Fb:swf. The problem I'm having right now is that I'm returning the fb:swf from my PHP script, and the waitforclick=false is not working. What must I do to meet the requirements of "after an Ajax call?" --14215948 02:25, 13 September 2007 (PDT)


I have the same problem with you,i don't know how to fix it yet.who can help me:)

Yes. Why the hell isn't this working? The Flash won't activate unless I click even though I created the SWF object through FBJS and setWaitForClick to false. If that doesn't qualify as Ajax I don't know what will. --192000478 19:43, 16 August 2008 (PDT)

Hahahahaha. That's not AJAX. You need to make an asynchronous request. That's AJAX. Asynchronous Javascript And XML. Derp!

[edit] wmode

I don't see why wmode is set to transparent...it mucks up a lot of flash files and there's no reason for it...

[edit] AS3 Components Do Not Display

One of my projects uses two components (Flash 9 - AS3): Datagrid and Tilelist. These components work fine when viewed from the web page that Flash publishes (a typical .html, not in an iframe), but when they are displayed using the <FB:swf> tag the components don't display. I use both the typical drag/drop method to the stage and the addChild() function. I also tested using other addChild() methods with simple movie clips of shapes and that worked fine. It seems to be exclusively a component issue. Perhaps its a security settings issue. Does anyone have any ideas?

I am/was having a similar problem, though with the Slider component. It has something to do with the 'wmode' setting--if I use wmode='window' it works fine, but if i remove that line the sliders in my project disappear. 501012646 18:11, 28 October 2007 (PDT)

I also had this problem, in my case it was a little sporadic. Most recently, components (including List, Label, Button) were showing up fine on a Vista desktop and my macbook (FF, IE7 and Safari), but not on an XP machine (XP machine has player 9,0,47,0, I'll confirm the other machines). I should note that in the past I have seen the same Vista machine not produce the components (I actually thought Facebook had fixed something when I saw it last night). Despite regular testing, I don't recall ever seeing the problem on OS X. wmode="window" did the trick in my case as well.

A Fix: I've solved this problem. This link provided the clue. Seems that wmode transparent in Firefox will stop "Render" events from being sent. Calling component.drawNow() causes the component to draw. I've tested this with the textarea and scrollbar and it works. You will have to call "drawNow()" whenever you update the component (e.g reset the scrollbar maxScrollPosition) as it wont work on its own, however it will redraw in response to user input, so this is not a huge porblem. --208900213 20:28, 27 November 2007 (PST)

[edit] getURL? I take it this has been disabled?

Is there anyway to get around this?

using a target of "_blank" works, but nothing else I tried, eg "_top", did.

== Update: 2008/01/03

This, I believe is related to a recent change in FlashPlayer

http://kb.adobe.com/selfservice/viewContent.do?externalId=50c1cf38&sliceId=2%3Cbr%20/%3E

Is there any plans for FB to change the current policy of setting the value of AllowScriptAccess to "never"?

All navigation from within embedded fb:swf elements (other than target='_blank') is now broken as a result.

I second this. It's a big problem for developers wanting to use the JS API. --522767188 18:25, 23 June 2008 (PDT)

We need getURL "_self" please!

Yes, we need to resolve this.. navigateToURL must be able to use "_self"!! :)

[edit] fb_sig_profile ?

is the fb_sig_profile information on the article page information outdated?

it looks like it should be fb_sig_profile_update_time which is getting passed rather then fb_sig_profile which I am not seeing being passed in at all, possibly just because I'm working on the canvas page?

either way fb_sig_profile_update_time is missing.

[edit] Disable right mouse click with swRemote parameter

It would be nice when you could add the feature to disable right mouseclicks on swf files.

This would be the parameter:

 <param name=swRemote value="swContextMenu='FALSE'">

Here is the relevant Adobe TechNote on this:

http://www.adobe.com/go/tn_14555


[edit] scale parameter

scale - Possible values: showall, noborder, exactfit. default (Show all) makes the entire movie visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders may appear on two sides of the movie. noorder scales the movie to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the movie. exactfit makes the entire movie visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur.

[edit] Pass User Name to Flash

One way to do this is by querying facebook and passing the result as 'flashvars':

 <?php
 $tmp=$facebook->api_client->fql_query("SELECT name FROM user WHERE uid=$user");
 $nam=$tmp[0]["name"];
 ?>
 <fb:swf
   swfsrc="http://www......................."
   flashvars="u_name=<?php echo urlencode($nam);?>" >

Then in your flash presentation, the global variable 'u_name' will contain the name --512493462 08:01, 7 December 2007 (PST)

[edit] How to add BASE attribute to EMBED/OBJECT tag?

We use RUNTIME SHARING in our Flash-application. But RUNTIME SHARING does`nt work without setting BASE attribute in EMBED tag (because the FBML default directory does`nt agree with the flash-application directory). How can we add BASE attribute using FBML or any other way?


I second this request. I think that like flashvars we should be able to customize certain embed parameters.

Ditto. I'm trying to embed a SlideShowPro swf, and am finding it impossible to do without specifying the base attribute.

FYI: I've filed a bug/enhancement request on this issue: http://bugs.developers.facebook.com/show_bug.cgi?id=5438

[edit] Missing black background from Flash file

I uploaded a flash file on Facebook. The background is supposed to be black, but it doesn't show on Facebook, only when I preview Flash, it plays like it should with a black background. Any ideas how this could be fixed? Thanks!

I have exactly the same problem. Please help.

The background of the Flash object defaults to transparent on Facebook. Use the swfbgcolor tag to set the desired background colour of the Flash object (for example, use <fb:swf swfsrc="http://..." swfbgcolor="000000" \> for a black background.

[edit] FB:SWF Profile Problem in Safari 3.1.2

Hi there,

I've been developing an application that sets an embedded youtube video into a user's profile, and ran into a weird glitch in the old facebook (using Safari) which went like this.

Clicking on the required overlayl image loaded up the embedded youtube video player in its initial state... no problems. Clicking play, and all of the buttons, worked as I expected it should. However, if I were to collapse the profile tab and reopen it, rolling over the you tube video control buttons lit them up (indicating that it was registering the roll-over), but clicking had no effect. The swf was locked up. I had this same problem with my own swf, so it's not a youtube issue.

Now, on the new facebook, the same problem exists in Boxes, but right from the get-go. The swf and its overlay image load in fine, but clicking on the image brings me to a static/locked swf file. The box works perfectly in IE, Firefox, & Opera; it's driving me nuts in Safari. However, the canvas page works fine in both the new and old facebook when running Safari.

I'm really at a loss here. I've played around with the different wmode settings but to no avail.

Any sympathizers or heroes out there?

[edit] Fullscreen mode

Currently fb:swf suppresses Flash fullscreen mode. I'm wondering what was the reason behind the decision? Do you have any plans to make it work?

I've seen several requests for the feature in the forum. An examples would be a video or a game one can open in full-screen.

In case you care about security, I don't think fullscreen mode in flash is dangerous for the user experience. Flash app goes to fullscreen mode ONLY in response for the UI action, like key-press or mouse-click. See this article http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html

This feature is very essential for our application to open the app in fullscreen from the profile. We really need it. Hope you can help us.

I know one can embed Flash player inside iframe, but it does not work for the profile.

Comment: I can see this as being an issue as with fullscreen the ads that facebook runs cannot be seen on the side of the app losing them potential revenue. Just my opinion even though I would love to see fullscreen supported.

[edit] swf dissapears when loading a fbjs dialog in IE or Safari

Hi there,

when I load a FBJS dialog overtop a swf, the swf completely disappears, music goes mute until i close the dialog again, is there a way around this?

Thanks --548871286 01:51, 11 July 2009 (PDT)

You should position your dialog such that it doesn't overlay the SWF object. Pete (563683308 14:53, 13 July 2009 (PDT))

[edit] Useful info about setting flashvars from JS

In this thread: http://forum.developers.facebook.com/viewtopic.php?id=25762

[edit] Need to correct Notes

 Notes
   * Currently, Facebook requires a minimum Flash Player version of either 9.0.159.0 or 10.0.22.87 for all <fb:swf> tags. When Adobe discontinues security updates for Flash 9 (Flash 10 is unsupported on Windows 98 and ME), it will no longer be supported anywhere on Facebook. 
 ...
  2. Strip the fb_sig_ prefix from all parameters,  and make sure the keys are lowercase . <- delete bold part

if make keys to lowercase MD5 from keys+appsecret return wrong hash.

Sorry for my bad english )

reference