Journal
I want to hear from you.
Kimili Flash Embed - WordPress Edition
Update! 2.25.05
There’s a new version of the Kimili Flash Embed – Wordpress Edition available. Get it while it’s hot.
Update! 2.22.05
If some of you have been having problems embedding, we are guilty of a very silly oversight. The way we were parsing out the<kml_flashembed>tag was incorrect. Please re-download the zip and re-install the plugin. All should be good now.
The original version of Kimili Flash Embed is a Textpattern plugin which gives an easy interface to Geoff Stearns’ flash detection and embedding javascript. With the plugin, one can put a simple tag into an article instead of having to drop in a chunk of Javascript to display flash content.
Using Geoff’s script to display flash content has many advantages over other methods, including flash player version detection, serving up alternate content if needed, bypassing incorrect player detection and standards compliance.
When I approached Geoff about doing the plugin for Textpattern, he was very cool about it. He then told me that he uses WordPress to manage his blog and asked me about the possibility of porting the plugin to a WP version. After some trial and error, here it is.
kml_flashembed_wp.zip
Get the latest version, always available at the KFE Home.
In the zip you’ll find the following files:
- flashobject.js – this is Geoff’s script
- kml_flashembed.php – the WordPress plugin
- readme.txt – usage instructions
Usage
Using this plugin is practically identical whether you are running Textpattern or WordPress.
The first thing to do is make the script available to any page you’d like to place flash content on. Put flashobject.js in a folder called js off of the root of the site. Then add the following line of code in the head of your page templates:
=<pre><script language="JavaScript" type="text/javascript" src="/js/flashobject.js"></script></pre>=
After you’ve done that, just drop the kml_flashembed.php file into your wp-content/plugins directory and activate the plugin. Now you can add Flash content to your pages using a tag like this in your articles:
=<pre><kml_flashembed movie="filename.swf" height="150" width="300" ></kml_flashembed></pre>=
It is important to double quote your attributes in this tag. Single quoting may trip things up a bit.
The available attributes for the <kml_flashembed /> tag are:
movie (_required_)
The path and file name of the flash movie you want to display.
height (_required_)
The height of the flash movie. You can specify in pixels using just a number or percentage.
width (_required_)
The widthof the flash movie. You can specify in pixels using just a number or percentage.
align
(l, t, r, b) – Left, Right, Top, and Bottom align the movie along the corresponding edge of the browser window and crop the remaining three sides as needed. Defaults to centered.
alttext
The text or HTML you want to display if the required flash player is not found. If you want to use HTML inside this attribute, there are some important differences to remember, as we’re inside of another tag. Specifically:
- Use curly brackets:
{p}for tags instead of normal braces:<p> - Use single quotes for HTML tag attributes, as your kml_flashembed attributes should be double quoted.
- Example Syntax:
alttext="{img src='noflash.jpg' alt='You need flash' /}"
bgcolor
(#RRGGBB, hexadecimal RGB value) – Specifies the background color of the Flash movie.
fvars
Pass variables (name/value pairs) into your movie with this attribute. You can pass in as few or as many variables as you want, and they can be hard coded or PHP variables. Syntax is as follows and the spaces are optional:
fvars=" name = value ; name = value "
fversion
You can specify what version of the flash player is required to play your movie. Defaults to 6.
id
You can give your movie a unique id on the page for scripting purposes.
loop
(true, false) – Specifies whether the movie repeats indefinitely or stops when it reaches the last frame. The default value is true if this attribute is omitted.
menu
- (true) displays the full menu, allowing the user a variety of options to enhance or control playback.
- (false) displays a menu that contains only the Settings option and the About Flash option.
noscript
Text or html content you would like to display to users browsing on a non-javascript browser or with javascript disabled.
play
(true, false) – Specifies whether the movie begins playing immediately on loading in the browser. The default is true.
quality
(low, high, autolow, autohigh, best ) – Specifies the playback quality of the Flash movie.
salign
(l, t, r, b, tl, tr, bl, br) – Specifies which edge or corner the movie is aligned to in the browser window while and cropping the remaining sides as needed.
scale
(showall, noborder, exactfit) – Dictates how the movie fills in the specified target area.
target
This is the ID of an element on your page that you want your flash movie to display within.
wmode
(window, opaque, transparent) – Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser.
You can find out more about Flash player attributes here
abjdiat says:
22 February 2005 ∞
is there any way to using this embed in html directly?....
Jeff Minard says:
23 February 2005 ∞
This could be spliced into a single PHP file. I have a plugin that makes Live comment previews and it uses JS too, but instead of focing people to download/upload/insert an extra JS file, the plugin does it for them.
Just check out the source code, I thought it was a neat idea.
Jeff Minard says:
23 February 2005 ∞
Sure thing :D I’ll probably end up using this too, so it behooves me ;)
david ehlers says:
22 March 2005 ∞
do i need this to add flash to my blog?
David Ehlers says:
23 March 2005 ∞
Great.
Do you have a sample file I can view, I makes the area, but doesn’t load the movie.
I noticed the description in the plugin page cpanel has a slight error:
“Provides a wordpress interface for Geoff Stearns’ excellent standards compliant Flash detection and embedding JavaScript. The syntax is .”
The last tag is missing the “kml_” -
flash intro guy says:
3 April 2005 ∞
Looks very nice. Is there some significant advantage besides saving a few lines of code. Normally you won’t publish lots of flash banners or other SWF files on a page. I may give it a try though. Thanks.








whoo says:
22 February 2005 ∞
wordpress 1.2.3, doesnt work :(