Post Archive

› November 22, 2005

Request for help: Flickr badge inclusion with FlashObject

  • Reported by Andreas

I am looking for a way to include a Flickr Flash badge in an XHTML 1.0 Strict document by means of the FlashObject method, which most of you probably know.

The FlashObject method seems to work fine with other Flash animations, but I can't get it to work with the Flickr Flash badge. I've set up a test page, so you can have a look at what exactly I'm talking about. I'm probably simply overlooking something, but can't figure out what. Any help is appreciated!

NB: I crossposted a similar entry in the Flickr Hacks group a couple of days ago - no answer yet though...

Update: The file I was linking to wasn't a flash file, but an HTML file containing JS variables for generating the Flash badge. So I fired up Firefox and grabbed the real flash file's URI of 392 characters minus its 32 "authentication hash" characters from the Page Info panel. The test page is updated, too. doesn't work anymore. Thanks to Patrys for pointing out my mistake.

Update 2: Sigh. Apparently, you need an API key to make this work permanently...

Comments

1. November 22, 2005 06:54 AM

Quote this comment

Matteo Posted…

Hi, if you can't resolve it, just try my method... http://www.totanus.net/tfl/ Bye Teo

2. November 22, 2005 06:55 AM

Quote this comment

Patrys Posted…

I know this is no answer to your question, but I'm a bit curious: why not just use a normal <object/> element?

3. November 22, 2005 07:00 AM

Quote this comment

Patrys Posted…

Trying to be more helpful:

<object width="200" height="150"
type="application/x-shockwave-flash" data="flash/somefile.swf">
	<param name="flashvars" value="foo=bar" />
	<param name="movie" value="flash/somefile.swf" />
	<param name="quality" value="high" />
	<param name="scale" value="exactfit" />
</object>

4. November 22, 2005 07:09 AM

Quote this comment

Matteo Posted…

Patrys, are you talking with me? However the code above doesn't work for Safari (flashvars). But if you put flashvars as OBJECT attributes it doesn't validate. TFL is a method to bypass those problem.

5. November 22, 2005 07:17 AM

Quote this comment

Paul D Posted…

Andreas, have you tested the html that FlashObject generates on a static page to see if that works?

6. November 22, 2005 07:29 AM

Quote this comment

Patrys Posted…

My point is that using JS to generate page content is a bad idea if it can be done without any script dependencies. Especially if you only JS to fool the validator. I mean - if you are still going to generate invalid XHTML, hiding it from the validator won't make you any smarter nor will it enlarge your private parts. Either do it the right way or live with validation errors (as validator is just a tool and not the oracle). Or, alternatively, you can switch to another DOCTYPE.

7. November 22, 2005 07:39 AM

Quote this comment

Andreas Posted…

First, a disclaimer: I'm a complete flash noob ;-)

I've just updated the test page - that should make things a bit more clear.

Matteo/Patrys: the FlashObject page reads "Older Safari versions ignore param tags". So that's why I decided to go with FlashObject. I gave the <object /> solution a try though, and the same thing seems to happen. My "flower" example is no problem, but no Flickr badge to see.

Paul D: hmm, I don't think I've tested that. FlashObject works with my flower example though... And as the <object /> solution also doesn't seem to work, I think there's something else going on. Or am I wrong?

8. November 22, 2005 07:46 AM

Quote this comment

Patrys Posted…

Matteo: No, I'm not referring to you but to FlashObject. If I was referring to you I'd say that your article was quite entertaining but you are wrong when you say that ALA invented something that is in HTML specs: <object/> semantics. May I also point out that current Safari versions have no problem with passing params the correct way.

9. November 22, 2005 07:51 AM

Quote this comment

Patrys Posted…

Andreas: Now I see where your problem is. You are trying to use this as the Flash source while in fact this is a full HTML page. Try replacing the whole thing with a simple <iframe/> element, giving the above as source.

10. November 22, 2005 09:37 AM

Quote this comment

Andreas Posted…

Oh, Patrys, you're completely right. For some reason I never hit Ctrl+U when looking at the Flickr flash badge - silly me. I've been trying to sift through the JavaScript in order to construct a link to the flash file itself, but so far without success. It seems like using an iframe is the only choice. And iframes are not XHTML 1.0 Strict. :-/

11. November 22, 2005 09:50 AM

Quote this comment

Nate Posted…

Maybe the best way to do this Andreas is to use Todd's SlideShowPro, which is specifically flickr enabled and highly customizable. I'm speaking from experience when I say that you don't have to be a Flash guru to use SSP and even customize it to your liking.

12. November 22, 2005 10:09 AM

Quote this comment

Andreas Posted…

Got it. See my updated entry for more details.

13. May 23, 2006 07:53 PM

Quote this comment

BillyWarhol Posted…

Is there an info area on hacking the Flickr Badge? Cheers! Billy ;))