Todays serving is another WordPress plugin. It is written as part of my community service program and with its release, I hope to have paid back what I have taken from the open source community (damn you, GPL, and your “stay free” mantra).
In any case, this plugin is for the minimalists who needs to embed Flash files in their WordPress content. Look, see:
Flash files are embedded thusly:
That’s what there is to it, and that’s all there is to it. There’s no options page, and while you can specify a plethora of other attributes (see readme.txt), the above are the only required ones.
So how is this different from Vipers Video Quicktags or Kimili Flash Embed, plugins that also allow you to embed Flash? Well this one only does Flash. This one does it using the superior SWFObject 2 embed method and with as little code as possible. Finally, and most importantly, this plugin goes to eleven.
Update, December 2009: Retirement
It’s my pleasure, actually, to announce that this plugin is now retired in favor of the SwfObj plugin.
This plugin was initially built because no other plugin embedded Flash simply and appropriately, which it did somewhat well. After building it, however, I became aware that it was not enough to simply build a plugin that easily embedded Flash objects using SWFObject, it needed to work with RSS Feeds (static publishing), and ideally the builtin WordPress uploader should be used to allow you to upload your Flash files. That’s when I discovered SwfObj by Matt Carpenter.
At the time, SwfObj worked remarkably well, both with RSS feeds, simple shortcodes and clean uploading of Flash files. Dynamic publishing wasn’t working superbly though, and I missed the option to specify defaults for “window mode” (useful if you need HTML dropdown menus to be able to overlap your Flash content). So I emailed Matt and asked him whether these features could be added in. Not only could they, but Matt agreed to include the flash shortcode used by this plugin.
The net result is that you Flash Shorttags users can now migrate to SwfObj and not have to edit a single post; everything will work, and you’ll have new features. My thanks to Matt for tweaking his plugin. I’m sure this’ll be to the benefit of WordPress users. That’s why as of today, Flash Shorttags is retired and will no longer be developed. I encourage you to switch to Matts plugin.
To be quite honest, I’ve never bothered with expressinstall at all, so I really just added the SWFObject parameter. This plugin here, will really just act as a proxy, with the parameters simply tunneling through WordPress’ terrible textmangler, unharmed hopefully, into SWFObject. So I’m afraid I’ll have to relegate you to the SWFObject documentation.
As for “menu: false”. that should go under parameters, but if you’re no stranger to SWFObject I’m sure you’re all set on that. Personally I’ve been using SWFObject 1.5 for a while, and since the syntax is all different in 2.0, I’ve been off my game.
By the way, did you know you could write Stage.showMenu = false; inside the Flash movie? That is, provided you make the movie yourself. Then you won’t have to provide parameters.
Oh, and because the code is extremely simple (we’re talking some 20 lines of code), it should be very easy to extend to embed other things. Go open source!
As a small service announcement, I have discovered a bug in this plugin. As it stands, you can only embed one Flash file per post, as the ID of the embed is generated from the post name. Since each embed needs a unique ID, this will cause the javascript replacement call to fail.
Off the top of my head, you have to add something to your functions.php, something like add_filter / text_widget / do_shortcodes. I think it’s possible, but I do think it requires a little PHP wizardry. If anyone can connect the dots, please add a comment.
well done sir.
Thank you, sir.
Nice, I’m a big fan of SWFObject 2.0, though I don’t have any mighty need to post flash into my blog just yet; this’ll definitely be the plugin I use.
Is there any customisation for using expressInstall by default?
To be quite honest, I’ve never bothered with expressinstall at all, so I really just added the SWFObject parameter. This plugin here, will really just act as a proxy, with the parameters simply tunneling through WordPress’ terrible textmangler, unharmed hopefully, into SWFObject. So I’m afraid I’ll have to relegate you to the SWFObject documentation.
Not to worry, I’m sure I can just pop the express install code in myself.
Along with my usual menu:false parameter.
I’d expect you to be able to, yes.
As for “menu: false”. that should go under parameters, but if you’re no stranger to SWFObject I’m sure you’re all set on that. Personally I’ve been using SWFObject 1.5 for a while, and since the syntax is all different in 2.0, I’ve been off my game.
By the way, did you know you could write Stage.showMenu = false; inside the Flash movie? That is, provided you make the movie yourself. Then you won’t have to provide parameters.
Very nice Joen. I’ll be sure to use this whenever I need to embed a Flash movie in a post. Nice work. Cheers.
Thanks much, I appreciate it!
Oh, and because the code is extremely simple (we’re talking some 20 lines of code), it should be very easy to extend to embed other things. Go open source!
As a small service announcement, I have discovered a bug in this plugin. As it stands, you can only embed one Flash file per post, as the ID of the embed is generated from the post name. Since each embed needs a unique ID, this will cause the javascript replacement call to fail.
I’ll fix this.
It’s now fixed, but not yet uploaded. I’m going to attempt to get this to the wordpress repository instead.
Very nice! you made life very easy! Nice job
[...] Short-tags eklentisini Joen Asmussen yazmıÅ
I installed the plugin – activated and then added this line of code to a page:
[flash src="images/coverflow.swf" width="590" height="400"]
It’s not working after I update – any ideas? Am I missing something?
If the site you’re having trouble with is http://www.d2lgraphics.com/, then the SWFObject javascript is not being included. I have no idea why.
I figured it out.
Hi,
Works fine into posts but how can I include your plugin in a text widget?
Thanks
Off the top of my head, you have to add something to your functions.php, something like add_filter / text_widget / do_shortcodes. I think it’s possible, but I do think it requires a little PHP wizardry. If anyone can connect the dots, please add a comment.
Added instructions in this post, on how you make this plugin work with widgets.