Detecting Flash Player


When visitors arrive at your site, you don't necessarily know which version of Flash Player is installed on their systems, or whether they have Flash Player installed at all (although the likelihood that they have some version installed is very, very high). The Tech Bookstore requires that visitors have the correct version of Flash Player to see the content of the SWF files that are loading into the Tech Bookstore (such as the tour) and the bookstore itself, which is Flash Player 8. Detecting Flash Player is a complex task to do well because it ultimately requires JavaScript written in to an HTML page. However, you can let the Flash publishing process do the hard work for you by creating a player-detection system instantly when you publish the file. Here's how.

1.

Open loader.fla and open the Publish Settings dialog box by choosing File > Publish Settings. Import the Publish profile you just created in the previous exercise.

Import the Publish profile that you created in the previous exercise called Tech Bookstore. Click the Import/Export Profile button and select Import from the drop-down list. The Import Profile dialog box opens, in which you can choose a profile to import. Click TechBookstore.xml and then click the Open button.

Now the Tech Bookstore profile is available in the Current Profile menu. Select the Tech Bookstore profile. The profile maintains the same settings that you used for the previous SWF file that you modify in a few areas in the following steps.

2.

Make sure that the Flash and HTML check boxes are both selected on the Formats tab.

Selecting this option means that the HTML page is created when you select the check box. You need to publish both HTML pages and a SWF document. Change the name of the HTML file in the HTML field to bookstore.html. This file will be modified later in this lesson. You do not need to modify any settings on the Flash tabyou can leave the default settings from the Publish profile you made earlier.

3.

Select the HTML tab. Select the Detect Flash Version check box, and deselect the Loop and Display menu options in the Playback section. Click the OK button when you're finished.

You need to make some changes on the HTML tab. Select the Detect Flash Version check box to create a Flash Player detection system. When you select this option, Flash will add the JavaScript that detects for the Flash Player version you specified in the Flash tab (Flash Player 8, in this case). If users don't have Flash Player installed, they are automatically redirected to http://www.macromedia.com/go/getFlash/, where they can then download and install Flash Player or the Flash Player version they need to see the Flash content on your web page.

When you are finished making edits, click the OK button to return to the Publish Settings dialog box. Make sure that you have deselected the Loop option under the HTML tab, and click the Publish button when you are finished.

Note

You can use Flash Player detection only if you publish to Flash Player 4 or greater.

The other settings that were available under the HTML tab do not need to be modified, but here is a brief breakdown of what the settings under the HTML tab are used for:

Template: This setting specifies a kind of template to use for publishing the HTML portion of the movie. Click the Info button next to this setting to find out more about each kind that is available.

Dimensions: You can set the dimensions for the Flash SWF file that will be embedded in the document. The default Match Movie size is the current dimensions of the Stage, although you can set a different size, measured either in pixels or a percentage.

Playback: The playback options control how the SWF file plays at runtime. Loop means the SWF file returns to Frame 1 and plays again after it reaches the final frame on the Timeline. You can pause the SWF file when it begins using the Paused At Start option, and control the playback manually or use the contextual menu. You can choose whether to display a contextual menu in the running SWF file by selecting or deselecting the Display menu option. You can also choose whether to use device fonts in the SWF file (as were defined in Lesson 3 on using text). Select the Device Font option to use device fonts with static text. Note that the static text must be specifically set to use device fonts.

Quality: You can set the SWF file quality from Low to Best in this menu. Low doesn't use anti-aliasing and affords the fastest playback. However, Auto-Low will attempt to use better quality when possible, but also attempts to play back the SWF file quickly. High is the default that we use and always use anti-aliasing, but if there is animation, bitmaps are not smoothed (smoothing looks better but slows down the SWF file playback).

Window Mode: You can control the wmode attribute in the HTML file using this option. The Transparent Windowless option sets the background of Flash documents to transparent and removes the browser window around it (including the title bar). For example, you would use this mode if you were making one of those ads that appear to float over an HTML page. Opaque Windowless leaves the background in the Flash document, but still removes the browser around it. Always remember to offer some kind of button to close the SWF file somewhere in the SWF file. Window is the normal default mode where the Flash document appears in a normal browser window.

Note

Not all browsers support windowless mode. As for major browsers, recent Netscape browsers now support the windowless mode (NS 7+), as do Internet Explorer 5 (Windows) and Internet Explorer 5.1 (Mac) and above.

HTML Alignment: Helps position the SWF file in the HTML page to the various sides of the browser window.

Scale: This option scales the SWF file if you changed the dimensions of the file in the Dimensions setting. Default maintains the aspect ratio of the original SWF file, whereas Exact Fit displays the document without keeping the aspect ratio, but will fill the dimensions you set. No Border scales the SWF file while keeping the aspect ratio, but it crops the Stage if necessary. No Scale stops the SWF file from scaling when the user resizes the browser window.

Flash Alignment: This option aligns the SWF file in the browser window and determines cropping if it is necessary. This affects your SWF file in particular when you choose different dimensions and the Stage is cropped.

4.

Save the changes you made to the FLA file. You can close the FLA file, and Flash for that matter, when you are finished.

You are finished publishing the file. All you have left to do now is edit the HTML files that were generated and put all of the files online (or in a single place, so you can locally test the website).




Macromedia Flash 8. Training from the Source
Macromedia Flash 8: Training from the Source
ISBN: 0321336291
EAN: 2147483647
Year: 2004
Pages: 230
Authors: James English

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net