WordPress

In order to set up the self-hosted version of WordPress (WP), you need a host that supports PHP (v.4.3+) and MySQL (v. 4.1.2+). If you want to set up multiple WordPress installations (or use other database-driven software), you will probably want a host that offers multiple MySQL databases.

We suggest a Linux-based (Apache) server. Make sure you get enough storage—at least 1GB. Additional utilities that are helpful for WordPress-based sites include PHPMyAdmin (for working with your database) and SimpleScripts (for installing and updating WordPress).

In this chapter, we will cover:

► Developing a strategy with Flash and WordPress

► Embedding a .swf: via Kimili plugin

► Adding Flash detection with SWFObject 2.0 and embedding the .swf

► Adding Flash detection with Flash-generated JavaScript and embedding the .swf

Download from Wow! eBook <www.wowebook.com>

Developing a strategy to use Flash & WordPress

Identify your user level and a specific application. Develop an SEO strategy. Determine what files need to be configured and modified to achieve your goals.

Getting ready

There are an unlimited number of ways to use WordPress and Flash together. The needs, ideas, and abilities of no two users will be the same. The limits are determined by you—by your skill level and the goals you set.

The first step is to identify your level of familiarity with the Web and Multimedia design software. Be honest in your self-assessment—and don't be discouraged, no matter where you are starting today. Understanding your user level allows you to set reasonable expectations. Take a look at the following figures to understand your user level. With practice and experience, by accessing the many free resources available online and through training tools (such as this manual), you will increase your level of proficiency.

You may be a new blogger, or may have been blogging for years. You may be an admin user supporting a team using WP for business or organizational needs, a theme designer, or a plugin developer. This book is written with you in mind, assuming that you are familiar with WP basics, or are willing to become so.

new blogger

Little to no experience with administering a website

Publish content

experienced blogger

Can effectively use a CMS to manage online content

Extend WP with plugins

admin user

edit code in a text editor, use a FTP client, batch resize/ rename and unzip compressed files

theme modification

theme design

coding CSS and XHTML

write a cus-stom theme

plugin design

coding CSS, XHTML and PHP

write a WP plugin

Basic

Intermediate

Advanced

new user

Little experience with the Flash interface. Little or no coding experience.

animated banner add

designer

Can design, do animations, and add interactivity in the timeline. Has an understanding of action script

Create a slide show/image gallery. Work with audio & video.

Flash developer

Can create interactivity and animations through ActionScript. Also incorporates other coding languages/files as needed.

Writing a theme or plugin

Basic

Intermediate

Advanced

Flash takes care of your dynamic media needs, and WordPress makes it easy to administrate your site. The way to use them together is with SEO in mind.

In terms of density of information presented to a search engine, Flash is not as effective as XHTML, in spite of recent advances. A Flash animation can have a description tag, however, properly marked up XHTML that uses <hi> and <h2> to emphasize keywords and phrases, as well as including links to and from authoritative sources, will still have more SEO value when compared to a .swf.

Many industries and audiences expect or require Flash animations. Your marketing and SEO strategy should determine how you mix WordPress and Flash. The goal is content that people can read and enjoy that is also understood by engines and robots. For those of us who administer or develop websites, ease of use is also a consideration.

In your design, when blocking in space for animations, consider how they are both dynamic and static. An animation does what it does, however lovely it is, and nothing more. Once a user has seen the animation, there is often no reason to pay attention to it again. WordPress offers dynamic content—areas of the page that highlight and excerpt the most recent content from different areas. This encourages users to revisit and explore your site for new content and to pay special attention to dynamic content areas. While an animation measures change in frames per second, WordPress allows your users to measure the changes made since their last visit. In this sense, Web 2.0 represents a true change in technology—transforming the screen itself into an animation that you program—simply by publishing new content.

So, some Flash is almost always fine. But too much Flash is less useful to search engines, relative to XHTML. Additionally, Flash animations generally take more time to update than regular WordPress content.

There are other ideas about how to combine Flash and WordPress, which we will touch on in later and more advanced chapters. Our approach should be applicable to the majority of users.

Where to place the .swf?

Flash media can be included anywhere in a WordPress theme: in the header, in a post or a page, in a sidebar, or in the footer. It takes some time to become familiar with your theme files—determining which PHP templates are called when different parts of the screen are clicked. An overview of how WordPress works is useful.

A theme has at least three views, which represent the steps to a given piece of information, moving from home page to a category to a post.

A WordPress home page is traditionally a dynamic display of updates from interior sections (like a dashboard). It can also be a static page. It's often named index.php or home.php.

The category archive view is a dynamic display of the posts in a category. It sounds complicated, but it is logical. When a user clicks on a category, not one piece of information is returned, but many. This template is called category.php.

The archive view is so named because, though this piece of information may be featured in other parts of the site, the user has now arrived at the URL for an individual post. The URL can be used in links or bookmarks to refer back to this specific piece of information. Typically, the format is a long-reading pane.

page.php, sidebar.php, header.php, and footer.php work just like you'd think.

Edit and debug with Firebug

Knowing which PHP templates create pages on your blog is the first step to inserting a Flash animation directly into theme files. The next step is to determine specifically which <div> will contain the animation. Firebug helps us match up the correct <div> tag with the correct PHP template.

Get Firebug here: http://getfirebug.com/

Firebug is an add-on for Mozilla Firefox. This handy tool allows you to see the CSS and XHTML that make up any page by context-clicking (right-click in Windows or Ctrl-click for Mac) and choosing "Inspect Element." The window splits at the bottom. Bring your mouse down to the bottom-left pane. Hovering over a <div> tag causes the screen to be highlighted: blue for <div> width and height, purple for margins, and yellow for padding. Clicking on the blue <div> tag loads the bottom-right pane with entries from the CSS stylesheet that control its appearance. It is helpful to have such a visual representation to understand the structure of a site.

Viewing the source (PC: Ctrl-U/Mac: Cmd-Opt-U) of a WordPress blog can be a confusing experience. Keep in mind that the XHTML output is different than the component PHP. Your templates are not what you see when you "View Source"—rather, you are seeing the result of dynamic PHP calls as XHTML, styled according to CSS. This is what makes WordPress dynamic—there are no webpages. There are only PHP templates waiting to output your website, recreated each time as the most recent content.

Additional utilities

There are additional utilities we will be using throughout this book; a FTP client and a text editor are required for intermediate to advanced applications. Dreamweaver is an excellent tool for coding, if you have it. A fast running stand-alone text editor specific to coding has its own merits. Here are open-source utilities for Mac and for PC:

FTP Client: FileZilla, http://filezilla-project.org/download.php

Text Editor: Windows comes with Notepad and Mac has TextEdit, but these text editors are not set up to code for the Web. A text editor for coding gives you access to many additional tools and options, such as line numbers, keyboard shortcuts, and auto-formatting.

► PC: NotePad ++, http://notepad-plus.sourceforge.net/uk/site.htm

► Mac: jEdit, http://jedit.org

See also

► WordPress Theme Hierarchy, Chapter 7

Embedding Flash .swf files in WordPress

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 the Chapter 1 folder.

Getting ready

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.

Help

fit Dajhbsjid Post*

0 Install Flugins

li&fia

Searcn | Search Results I Jd aod re:t^r:c | Poi1

Liar | Ifenest | Recently Updited

ä® [ink-

Ter- |rj flashi

Seed PIusj lis

B Pagss

flame Version

Mir»

Descri prion

ST) Appsarm oe ■

Flash Video Player 4.0.6

****

1 -e flae1" video aiugh for Uiarcpr&ss =llouis ttie sdditi; n of video f=r.d oiher med a]ra s wordwes; webd:? Rtandanrl!?-.-flmp( anr markup ?.nd the 1 = ?rlin3 nfwrv gnurre Rofrwara ['erran wijari'^'s =1 v Plsyer and senff Stearns 3W=0.'.ri_L¡dvdtuiplLibrary), Afu upliu 4 men. isdaeildjts 1» III puil-lsvel uvsi ill» fur bihJIsw -Ut.-iiiLzlnjn. Inst: Had :n is :üc-;end easy, and _o addi: cnal setupr'c . DyJosh.a Cldridz«,

-

Them«

rlnsh Toq Cloud 0.4

T~is p ugin a lows yD- tc quickly rscrt a tog cloud ~i:dc of flash. ]f you use WordPrcos 2.3 or higcr o~c but yoj ere dill search rg for comet*" ing t» 5*.

Ins:; 1

Add New Themes ujitom Head sr

WP FLASH TITLES 2.0 PLUGIN

•kirk-iKi

a] ow; you 13 :iq> ay you' poa titles in any -ont, 00 our = nd sae yoi wem .c will a h> refai'i ynur firigin.= 1 html Ktyling of ynur titles and ri spiiy that tn users wn don't have f as- nsa lad. It is ;j |v c.stom sab t via the Opdons la: n vrorooress. It is searc- enqins friendly j-d easy to imp emenL Dy Gam Du^dqe,

rnstalft-fidd New

nv rlnsh i.a.6 fullscreen Video Plover

E_tcd flash vi:003 using t-c *:LV Foo'i -ul scree- Vdco Pcycr*. The F.V Ploysrccn be config j-c: .ndcr ' Dp: ore» = FLV Hayar*. Ho« to uee: Lhashuiieo vi:so-:«mo-vidBo.tlv t\.

Tie wehsre ""1 t'lfl player s: http:j7iiwd.vi-ftn-f v-f asn-fii Isnresn-vidHn-p -yer/ Möiö'sd Iiik Lu hit VMsbste: illp://wMW.vid<sj-'c5ih.di Hwic i Fldu.

ITS TCKIIs

Flash Curlex 1.0.9

T"iisp uqin irovdes easy erbedd nq of flash-based video-s from vario.s poiali and MFD-fil« ( ncidinq olaye-1 wt" gone rot ion r c oorrosp-j-ding ink.

You ca*- :opy :rs tull URL ot :re vidao and en:sr 1: r vour post io' pa:el cither by using tha :uic<t;g 1 Flash Cora*' (addrd by the ougii) o-jus: oy t/pin: '[flaihjLR.I/flssh]'. 1 he em>rdded Vic« wll bs ihown in ~.v= preview and v WUIK ... B^1 3lc'd Ever L;.

ills,; 1

H kttmg;

Kimili Fknli Embed 2.1.3

ki" Ii fldl- äiibed s a pl.uin fur ''"Vurdpteti LhdLd luni yo. Lu tds 1'/ pli.e fdbh • ■ _/ies un ywji bile. Euil. ujuii jovoscria: oodc, i: ss~rdards oompl ant, soorch eng ncfriendy, high y fIch:1c an: ■.!!frxrcircd, :s well

iiis,: 1

*'r:nq

Kl"- li Flafi- =mhed r lisss swFfihjAT is fully rnmps- hie uiirh ivnnri tress 2.es srrl lane' an- nla^«? ws 1 wrh most irilwi ilmji «. Ry PiiKrd Rcsd «1.

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

& Z>ashbozid c j" Josts IIS iTjfllj £ i ¡nfe

^ Corjuuejita

0>' Installing Plugin: Kimih Flash Embed 2.1.3

Downloading HaEa I patiace fTDm fT^t? /.Kjrdprm.jr i.'piusi V ti ni_i- i _ as n-tibsc . 1.1. J . iL?. IJ-ipnrkinc; t+nc pnrfcr^r. Tiifil.illinij I 11111: ■ .

cueceiall ly ingialled the p l i r Kbmll nosh Cmhed Z. 1 1 AcdüHi- anij^r^J m | p«i plimin "

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 I

parameters with the respective path, height, and width of your swf: I

/fc»^ [kml_flashembed movie="/path/to/your/movie.swf" I

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:

wordpress and flash

Just another word Press webioa

Hello world!

January 1-51,30110

Hello world!

January 1-51,30110

Posted in Uncategorized | Edit | ï Comment »

Pages

» About » fllekr Second Page

Archives

* January 2010 » October 200?

Categories

Bin aroi I

* Development fclog

* Docurvifcritatiori

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.

Adding Flash detection with SWFObject 2.x

Detect which version of the Flash Player a viewer has available and supply alternative content in the event that the necessary Player is not available. The alternative content, in this case, will be a link for the viewer to acquire the appropriate Flash Player, if desired. To assist in expressInstall of the Player, the .swf will be registered with SWFObject. This method of setting up Flash Player detection does not require the use of a plugin and gives you easy and direct access to the generated code.

SWFObject 2.x is an open-source application brought to you by Google. To view the open-source license for SWFObject 2.x, please visit http: //www.opensource. org/licenses/mit-license. php. For further information on SWFObject and for another download source for the files needed to enable it to work, please visit http: //code.google. com/p/swfobject/.

For supplemental information regarding SWFObject 2.x from Adobe, please visit http:// www.adobe.com/devnet/flashplayer/articles/swfobject.html for an article entitled Detecting Flash Player versions and embedding .swf files with SWFObject 2.0, created by Bobby Van Der Sluis.

Getting ready

In the Chapter 1 folder, make sure that you have access to the following files: swfobject_ test.swf, expressInstall.swf, swfobject.js, and detection_generator.htm. They are located inside the Detection with SWFObject folder.

Move the swfobject_test.swf, expressInstall.swf, and swfobject.js files to the root level of your theme folder. Technically, the .swf you are embedding can be located anywhere, as long as you use the absolute URL in your code.

The detection_generator.htm file holds the open-source application that generates the necessary Flash Player detection code for you to put into your PHP template.

Be aware that hand coding your live website is a great way to learn and a fast way to work. You are probably going to make a few mistakes the first time through. It is in your best interest to have all of your information backed up before editing your site. You may want to have a text editing program or a WYSIWYG editor like Dreamweaver to maintain and organize copies of your files at each stage of development.

Another option is to set up WordPress locally so that the program runs on your computer instead of a server. XAMPP is a cross-platform utility that can help set up the Apache web server on your computer. You can download it here: http://www.apachefriends.org.

The benefit of this approach is that you do not have to upload files via FTP or reload pages to see the changes you've made. Also, your work in progress will be private—no one will be able to see your site until you move your completed site from the local install to your server.

1. Open the detection_generator.htm file. To do this, either double click on the file or drag it onto your web browser icon:

2. For the SWFObject configuration section, leave the default settings for SWFObject (.js) as swfobject.js and for Publishing method as Static Publishing. Change Detect Flash Version to the version of the Flash Player appropriate for your animation. For example, the default of 9.0.0 is adequate. If you are using the latest and greatest capabilities of Flash CS4, instead change the version to 10.0.0. Check the box for Adobe Express Install and leave the file name as it is. This can be seen in the above screenshot.

3. For the SWF definition section, change the name of the Flash (.swf) to the name of your .swf file. In this case, change it to: swfobject_test.swf. Dimensions need to be changed to the width and height of your .swf file. Change this to 320 x 240 pixels. Flash content id can stay as the default. This can also be seen in the above screenshot.

4. For the HTML definition section, do not change anything.

5. Click the Generate button to generate the necessary Flash detection code in the window at the base of the application. Kimili generates the code and puts it into your WordPress shortcode. The SWFObject 2.x generator gives you direct access to your code. You then have to copy/paste the code to the appropriate location in your chosen template in WordPress. Your code should look like the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/19 99/xhtml" lang="en" xml:lang="en"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript">

swfobject.registerObject("myFlashContent", "10.0.0", "expressInstall.swf"); </script> </head> <body>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="240" id="myFlashContent"> <param name="movie" value="swfobject_test.swf" /> <!--[if !IE]>-->

<object type="application/x-shockwave-flash" data="swfobject_test.swf" width="320" height="240"> <!--<![endif]-->

<a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/ download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />

<!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> </body> </html>

6. Select the <div> tag in the body section of the code. Everything from <div> to </div> gets selected. Copy this (Edit | Copy or Ctrl-C).

7. In the sidebar of your WordPress Dashboard, click on the arrow to the right of Appearance. Then, click on Editor.

8. On the right side of the screen, you now have a list of all the templates that are in the root directory of the Theme folder. Click on the title of the desired .php file. This loads it in the Theme Editor.

9. Paste the code you copied from the code generator (Edit | Paste or Ctrl-V) into the appropriate Template and <div> tag. Refer back to Developing a Strategy: Where to Place a .swf? if needed.

10. For the head content, select and copy the following:

<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript">

swfobject.registerObject("myFlashContent", "10.0.0", "expressInstall.swf"); </script>

Back in WordPress, open up header.php by clicking on Appearance | Editor | header, php. Paste the selected text in the head section after the </style> tag and before the </head> tag.

The code generator creates the code for you based on the choices you make. It generates the code within the basic structure of an HTML page. The code generated is web standards compliant and supports the incorporation of alternative content.

The JavaScript elements in the <head> section of the .htm generated HTML output accesses the swfobject.js file. This is a library of JavaScript necessary for the Flash Player version detection process to take place. The JavaScript elements also register your .swf file with the library and tell it which version of the Flash Player is needed.

In the body section of the document, a <div> tag is created that holds the object and nested object information/method that delineates which .swf is to be played, the width and height of it, and what alternative content to display if the appropriate Flash player version is not found. Notice that special coding is used to account for the needs of Internet Explorer, for example: <!--[ if !IE]>-->

Using relative vs. absolute dimensions

If you want have your .swf dimensions relative (in percentages) instead of absolute (in pixels), you have two choices:

Choice #1:

1. Go back into the detection_generator.htm file.

2. Change the Dimensions to 100 x 100 percentage, as seen below.

1. Go back into the detection_generator.htm file.

3. Click Generate.

4. Copy/paste your new code as needed. Choice #2:

In WordPress, change the dimensions in pixels to dimensions in percentages. That section of code should look like this:

<object classid="clsid:D2 7CDB6E-AE6D-11cf-96B8-444553 54 0000" width="100%" height="100%" id="myFlashContent">

<param name="movie" value="swfobject_test.swf" /> <!— [if !IE]>-->

<object type="application/x-shockwave-flash" data="swfobject_test.swf" width="100%" height="100%"> <!--<![endif]-->

Dynamic Publishing instead of Static Publishing

The default setting for the detection_generator.htm file is for Static Publishing. The other choice is Dynamic Publishing. Static Publishing is able to reach a larger audience because of the way it is constructed. There is less dependency on JavaScript. The downside is minimal. As per Adobe's Bobby Van Der Sluis, Static Publishing does not have a solution for click-to-activate mechanisms. However, those are already being phased out of use (Internet Explorer and Opera were the browsers of interest with this). Dynamic Publishing relies more heavily on JavaScript, even for embedding the .swf file, so the audience reached is smaller. A couple of perks are that it generates less code and has no issue with click-to-activate mechanisms.

1. All you have to do to change the publishing method is open the detection_generator.htm file and change Publishing method to Dynamic Publishing, as seen below, leave the defaults as desired, and click Generate.

i— SWFObject configuration [ -SWFqbject ys): * Publishing method: * Detect Flash version: *

swfobject.js

Dynamic publishing 1 t 1 what is this? 10 .0 .0

Adobe Express Install: g ex pressInsta11.swf HTML container id: * myAlternativeContent what is this?

2. Notice there is slightly different and slightly less code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head>

<meta http-equiv=MContent-Type" content="text/html; charset=iso-8859-1" />

<script type="text/javascript" src="swfobject.jsM></script> <script type="text/javascript"> var flashvars = {}; var params = {}; var attributes = {};

swfobject.embedSWF(Mswfobject_test.swf", "myAlternativeContent", "320", "240", "10.0.0", "expressInstall. swf", flashvars, params, attributes); </script> </head> <body>

<div id="myAlternativeContent">

<a href="http://www.adobe.com/go/getflashplayer">

-ruh

<img src="http://www.adobe.com/images/shared/download buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> </div> </body> </html>

3. Copy/paste the necessary parts of this code into WordPress.

□ For the head section, copy/paste everything from

□ For the body section, copy/paste everything from

Hitting the "More" Button

More options are available to you in the SWF definition section of the code generator. Click the More button to see them (they will look like the image below):

-SWF definition [ - ]-Flash <.swf) • Dimensions; " Flash content id

Parameters?]

Flashvars: add

-SWF definition [ - ]-Flash <.swf) • Dimensions; " Flash content id

swfobjecLtest. swf

320 X 240

pixels

name

class

align

Choose...

play

Choose...

menu

Choose...

:

scale

Choose...

Î

wmode

Choose...

M

de vi «font

Choose... î|

swliveconnect

Choose...

Choose...

allowscript access

base

name:

loop

Choose... !

quality

Choose... I-Î

sallcjn bgcolor sea mles stabbing allowfullscreen aljowne working

Choose... ■ ;

Choose... 1 i | Choose... Choose... ■ i}

value:

value:

Choose and change Attributes and Parameters here if you would like the generator to create even more code for you. Many of these options are most useful when the .swf you are embedding is going to be the sole content of the .html page.

If you are doing a test run, you may want to change the quality setting to low to cut down on load time. Just remember to turn it back to the default or high when you are ready for the real deal.

See also

► Using the Kimili plugin to incorporate a .swf

► Adding Flash detection with Flash-generated JavaScript

Adding Flash detection with Flash-generated JavaScript

If you want to add Flash player detection to your web page, but do not want to reference an external file, this recipe offers an easy solution. Use the Flash Professional IDE to generate the .html page for you that contains JavaScript to detect a Flash player and will play your .swf. Then, copy/paste the needed code into your template in WordPress.

Getting ready

Make sure you have access to the javascript_test.fla file so that you can open the file and allow Flash to generate additional files in that same location. It is currently located in the

Detection with Flash JavaScript folder inside the folder for Chapter 1. Change the location of this file as you need.

1. In Flash, go to File | Open. Navigate to the javascript_test.fla file (or use your own .fla file) and open it.

2. Go to File | Publish Settings.

3. Make sure that Flash and HTML are checked, as shown in the previous screenshot.

4. Click on the Flash tab at the top of the dialog box, as seen below.

5. In the top section of the dialog box now showing, set the Player to the version you are targeting.

[rlTX In order for Flash to generate the appropriate code, you must target I Flash Player 4 or higher. I

6. Click on the HTML tab at the top of the dialog box, as seen below.

7. In the top section of the dialog box now showing, set the Template to either Flash Only or Flash HTTPS, check the box for Detect Flash Version, and type in the specific version of Flash to be targeted.

8. Click Publish at the bottom of the dialog box. A .swf file and .html file have now been created for you. The .html file holds a reference to the .swf as well as the JavaScript necessary for basic Flash Player detection.

9. The .swf can be moved to the root level of your site as needed.

10. Copy/paste the Flash detection code into a Template in WordPress.

□ For the head section, copy/paste everything from <script> to </script>

□ For the body section, copy/paste everything from <script> to </noscript>

You enter the necessary preferences for your .swf and .html files into the Publish Settings dialog box. When you click Publish, Flash generates the requested files. As long as the .html template you publish is either Flash Only or Flash HTTPS, the .html file will be generated with JavaScript, set up to detect the Flash Player you specified. If the appropriate Flash Player version is not detected, alternative information is displayed so that the viewer has the option to download the targeted and necessary version of the Flash player.

See also

► Using the Kimili plugin to incorporate a .swf

► Adding Flash Detection with swfObject 2.x

0 0

Post a comment

  • Receive news updates via email from this site