Kimili Flash Embed for Textpattern
The Kimili Flash Embed for Textpattern is the simplest way to place Flash content on your Texpattern powered site. It is easy to use and rich in features and flexibility.
Download
Current Version: 1.4
Release Date: September 24, 2007
Archived Versions
Although I strongly recommend that you use the latest version of KFE, available above, what follows is an archive of earlier versions, should you want them:
- kml_flashembed_txp_131.zip
- kml_flashembed_txp_12.zip
- kml_flashembed_txp_11.zip
- kml_flashembed_txp_10.zip
- kml_flashembed_tp_04.zip
- kml_flashembed.zip
Basic Usage
If you’re installing this plugin for the first time, the first thing you should do is add following line of code in the head of your page templates:
<txp:kml_flashembed_js />
That will add a <script /> tag to the head of your pages that links to the embedded SWFObject Javascript. Note – Be aware that this puts you into what we’ll call Legacy SWFObject mode. Curious? Continue reading…
SWFObject Mode
Due to the way IE7 handles certain Javascript as served by TXP when said Javascript is embedded in a plugin – it throws inexplicable errors – I have had to implement a new (old) way of dealing with this problem. Now, by default, the SWFObject javascript embedded in the plugin is actually FlashObject 1.3d. This is the last version of the SWFObject (née FlashObject) know to work correctly in this scenario.
Also included in the plugin distribution is SWFObject 1.5 as a standalone Javascript file. In order to use this version of the SWFObject code and unlock the new Express Install methods that come along with it, you need to take the following steps:
- Upload the
swfobject.jsfile included in the distribution to your site. - Add a
srcparameter to your<txp:kml_flashembed_js />tag that points to the file you uploaded in the previous step.
For instance, if you uploaded the swfobject.js to your /files/ directory, perhaps under the content -> files tab, you would reference it like this:
<txp:kml_flashembed_js src="/files/swfobject.js" />
Note – The path that you put to your swfobject.js file here should be absolute (for example: /files/swfobject.js rather than files/swfobject.js). That’s the only way to ensure that it will get loaded on all of the pages that need it.
Adding the src attribute to the <txp:kml_flashembed_js /> tag puts KFE into Current SWFObject Mode, making the xiswf attribute available and disabling the useexpressinstall attribute. The main advantages of this are that you use Geoff’s latest codebase and make the Express Install feature a whole lot easier. Omitting the src attribute from the <txp:kml_flashembed_js /> tag will revert KFE to Legacy SWFObject mode. In this mode, the xiswf attribute is ignored and useexpressinstall is honored.
In either case, the plugin will work with IE7, as well as any other reasonably modern browser.
Moving Along…
After you’ve done all that, as well as installed and activated the plugin, you can add Flash content to your pages using a tag like this in your articles or anywhere else in the textpattern environment:
<txp:kml_flashembed movie="filename.swf" height="150" width="300" />
The only required attributes in a KFE tag are movie, height, and width. See the KFE home page for all available attributes and advanced usage.
Using Flash Player Express Install
If you want to give visitors to your site the option to upgrade their Flash Player to the latest version as quickly and seamlessly as possible, you can now use the Flash Player’s Express Install functionality. KFE 1.3 introduces a new, simpler method for invoking the Express Install functionality which reflects changes in SWFObject 1.5. In order to use the new method, you need to invoke Current SWFObject mode.
General Notes
Your SWF files need to be a minimum of 214px wide by 137px high so the entire upgrade dialog can be seen by the user if the Express Install is triggered. Furthermore, if your Express-Install-enabled SWF is not at least that size, the Express Install function will automatically fail.
It may also be a good idea to only place one SWF with Express Install functionality on each page. This way users won’t be greeted with multiple upgrade dialog boxes and be forced to choose one. Onto the specifics:
Express Install in Current SWFObject Mode
In order to use Express Install in Current SWFObject mode, take the following steps:
Upload the expressinstall.swf to your site
You only need to do this step once. Included in the plugin distribution is a file called expressinstall.swf. This file provides generic Express Install functionality for any SWF on your site. Upload it to your site to the location of your choice. Uploading it under the admin’s Content -> Files tab is just fine.
The next steps all take place within the <txp:kml_flashembed /> tag.
Specify the minimum Flash Player version
Using the fversion attribute in the <txp:kml_flashembed /> tag, set the minimum player version required for your movie:
fversion="9"
Reference the expressinstall.swf file
Using the xiswf attribute, reference the expressinstall.swf file that you uploaded in the first step:
useexpressinstall="true"
You can optionally add the xiredirecturl attribute to redirect users who successfully upgrade their flash player. Make sure it is an ABSOLUTE path, complete with domain:
xiredirecturl="http://www.yoursite.com/bleeding/edge/flash/"
Express Install in Legacy SWFObject Mode
There are a few extra steps to take in order to use Express Install in Legacy SWFObject mode. They are:
Include and invoke the Express Install actionscript in your Flash movie
Add Express Install support to each of the SWF files that may require an upgrade. Copy the bundled expressinstall.as to the same directory as the .FLA file you want to use the Express Install option with. The call to the Express Install script should be on the first frame of your movie, and looks like this:
#include "expressinstall.as"// initialize the ExpressInstall objectvar ExpressInstall = new ExpressInstall();// if the user needs to upgrade, show the 'start upgrade' buttonif (ExpressInstall.needsUpdate) {// this is optional, you could also automatically start the upgrade// by calling ExpressInstall.init() here instead of the following lines// attach the custom upgrade message and center itvar upgradeMsg = attachMovie("upgradeMsg_src", "upgradeMsg", 1);upgradeMsg._x = Stage.width / 2;upgradeMsg._y = Stage.height / 2;// attach the button actions that will start the ExpressInstall updaterupgradeMsg.upgradeBtn.onRelease = function() {// the ExpressInstall.init() method is what kicks off the actual updateExpressInstall.init();}// if expressinstall is invoked, stop the timeline.stop();}
All other functionality of your movie should be moved to frame 2 to ensure compatibility back to Flash Player version 6.0.65
Specify the minimum Flash Player version
Using the fversion attribute in the <txp:kml_flashembed /> tag, set the minimum player version required for your movie:
fversion="9"
Add the useexpressinstall attribute to your <txp:kml_flashembed /> tag:
useexpressinstall="true"
You can also add the xiredirecturl attribute to redirect users who successfully upgrade their flash player. Make sure it is an ABSOLUTE path, complete with domain:
xiredirecturl="http://www.yoursite.com/bleeding/edge/flash/"
Help
Please refer to the Kimili Flash Embed FAQs section to help resolve the most common issues people come across when using KFE.
Bugs
If you come across a bug or an incompatibility, please contact me with the specifics. I will do my best to rectify it as quickly as possible.







