21.3. Detecting Flash Player Version

Problem

You want to detect the Flash Player version so you know that the user can view the published content.

Solution

Use the Detect Flash Version option in the Publish Settings dialog box, and then publish the .swf and .html files.

Discussion

When you publish SWF and HTML content from Flash 8, add Flash Player detection by clicking the Detect Flash Version checkbox in the Publish Settings dialog box. Unlike previous versions of Flash, the Flash 8 version detection script requires no additional files and pages aside from the standard SWF and HTML page. You don’t have to write (or copy) complicated scripts. You don’t have to manage lots of files. Selecting the Detect Flash Version checkbox in the Publish Settings dialog box automatically adds the necessary script to the published .html document.

Just below the Detect Flash Version checkbox, you can specify the minimum player version that you require. The major version is always the version of the SWF that you are publishing. For example, if you are publishing the SWF to Flash Player 8, the major version is 8. You can also specify minor version and incremental revision values if you want to require later player revisions. The Flash player detection script will test that the user has the required player version. If she does, the Flash content plays normally. If not, by default the user is presented with a basic HTML page that tells the user she must download a newer version of Flash Player to view the ...

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.