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.
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 forChapter 1. Change the location of this file as you need.
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.
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.
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.