-
Book Overview & Buying
-
Table Of Contents
WordPress and Flash 10x Cookbook
The most basic and fundamental way of using WordPress and Flash together is to insert an animation. The steps are:
1. Create an animation in Flash.
2. Export the animation as a .swf.
3. Upload the .swf to your server.
4. Embed the .swf in your site.
WordPress makes it easy to embed a .swf—here, we provide an in-depth review of the Kimli Flash Embed Plugin, (version 2.0.2) based on Swfobject 2.x.
If you do not have an animation to begin with, this section uses a sample Flash animation, found in theChapter 1 folder.
WordPress displays Flash the same as any other web page—through Flash Detection. Flash developers use swfObject 2.x and JavaScript for Flash Detection. Otherwise, non-specialists can use one of a variety of plugins to embed Flash media (SWF or FLV). Kimli Flash Embed is among the best of such plugins.
The easiest way to embed Flash in WordPress is through the plugin "Kimili Flash Embed for Wordpress."
http://kimili.com/plug-ins/kml_flashembed/wp
"Built upon the SWFObject javascript code, it is standards compliant, search engine friendly, highly flexible and full featured, as well as easy to use." Quoted from http://kimili.com/plug-ins/kml_flashembed/#usage (2009).
Installing Kimili Flash Embed (KFE) on your WordPress site is simple.
1. In your dashboard sidebar, use the downward pointing arrow to expand Plugins and then click on Add New.
2. In the Search bar, type: flash, as seen in the following screenshot.

3. Browse down to Kimli Flash Embed, click Install, and then Activate.

4. Now that the plugin has been uploaded and activated, the final step is to insert a Flash file in the .swf format.
5. Click on Posts | Edit and then the relevant post title (we will be using the default Hello world! post).
6. Click on HTML to enter the HTML view.
To add a Flash animation, use the following shortcode, replacing path, y and x parameters with the respective path, height, and width of your swf:
[kml_flashembed movie="/path/to/your/movie.swf" height="y" width="x" /]
7. The movie parameter is the only one required—height and width are optional. Though it is most efficient to size your .swf during export, the height and width parameters will resize a .swf file. If you do so, be sure to keep the numbers in scale proportion to avoid distortion For reference, look at the following screenshot.

8. If you're using the Visual Editor to write your posts, look for the red Flash button on the right. Click to launch the KFE Tag Generator, a wizard-like interface that will assist you in creating the necessary KFE tag. Again, the only necessary parameter is the URL to the .swf file you want to display.
That's it! You have now inserted your first Flash animation inside WordPress. It's easy to do through the shortcode or the KFE Tag Generator. Open another tab (PC: Ctrl + T /Mac: Cmd + T) to confirm:

Three main sections comprise the KFE Tag Generator: SWFObject Configuration, SWF Definition, and Alternative Content.
Configuration options are covered in more detail in the following section, Adding Flash Detection with SWFObject 2.x. Please see the How to do it... section.
Change the font size
Change margin width
Change background colour