SWFObject in the Default Publish Profile
by Paul SpitzerFriday, May 5th, 2006
As I’m sure most of you out there already know, recent changes to Microsoft’s Internet Explorer force a change in the way we embed Flash files in our HTML. At Fluid we’ve been using SWFObject , a useful bit of JavaScript that handles these changes quite nicely. The other day, after publishing several .fla files and having to update the generated HTML each time and eventually growing quite tired of the process, I decided it was time to give SWFObject a more permanent home.
The solution, modify Flash’s default publish profile to include a modified HTML template that uses SWFObject instead of the standard Object and Embed tags. Now, when I publish HTML with my .fla files Flash uses this new SWFObject enabled HTML. I was so happy with the result that I decided to package it up into an extension for others to enjoy.
You can find the extension along with release notes here.
May 5th, 2006 at 10:54 am
Great stuff! Seems like SWFObject is quickly becoming the standard embedding technique. They are even using it on Adobe.com.
One question: Is there a way to automatically add the ’swfobject.js’ file on Publish?
May 5th, 2006 at 11:04 am
Much thanks! I started this and just got bogged with work. Adobe’s solution is also an extension with Publishing templates (one https other http).
May 5th, 2006 at 11:42 am
I did this for internal use where I work.
Except I didn’t set it to the default template.
May 8th, 2006 at 9:10 am
doesnt seem to work properly if size is set to 100% with scale set to no scale
win2000 prof flash 8 published as 7
May 9th, 2006 at 11:25 am
Thanks for the replies.
>Is there a way to automatically add the ’swfobject.js’
I looked and short of adding the JavaScript to the HTML I do not think it is possible using the current publishing mechanisms provided Flash and JSFL. It would be possible however to write a command to do the job. Is this something of interest?
>doesnt seem to work properly if size is set to 100%
I’ve updated the extension adding support for additional parameters like size, scale mode, etc. The latest files are on the extension’s page. Enjoy!
May 16th, 2006 at 5:55 am
I just thought I’d report that I had no problems installing (and quickly testing) your extension on a Mac with Flash 8.
Nice work BTW. Really handy to have this in directly in Flash.
June 11th, 2006 at 5:20 am
I use the SWFObject Publish Profile Extension for a Flash.
).
It works OK, but I’d like to have a version of Flash inside the tag (so if the Javascript is disabled, it displays the OBJECT/EMBED version of Flash. Okay, it has the “Click to activate…” message - but that’s the price of disabled Javascript
It could be done through a configurable parameter useNoScript (true/false).
It would be of a great help!
Thanks!