How do I download flash files embedded using SWFObject

Neil picture Neil · Oct 11, 2009 · Viewed 12.2k times · Source

A site I use displays a flash file, which is embedded dynamically using SWFObject. I want to download the flash file locally, so I can run it when I don't have access to the net. However, when I try to open the url to the swf file, it demands an 'id' parameter that is normally passed by the SWFObject Javascript.

Specifically, the source of the page contains:

swfobject.embedSWF("/bin/loader.swf", "main", "100%", "100%", "9", false, flashvars, params, attributes);

And the flashvars have the following definiton:

var flashvars = {
        file_id: "imilc2lxnfft",
        app: "main-502.swf",
        show_play_button: "false",
        autoplay: ""

When I try to access site.com/bin/loader.swf, it says it requires a file_id parameter.

How do I pass the parameter and download the file to my desktop?

Answer

Jez picture Jez · Oct 11, 2009

You'll need to create a webpage to house the SWF you've downloaded that passes the same flashvars to it as the webpage you're getting it from. I'd use Firefox's right-click "save web page" function; choose to save 'Web page, complete'. This will save the page and all its support files somewhere. Then you should be able to edit that page down just to display the embedded SWF applet, and pass the necessary flashvars to it.