The Stand-Alone Flash Player and Projector


The stand-alone Flash Player and projector enable you to take your Flash right off the Web and onto the desktop without having to worry whether users have the plug-in. In fact, you don't even need to worry about them having browsers! Stand-alone players and projectors have similar properties and limitations, although they're slightly different.

  • Stand-alone player: This is an executable player that comes with Flash 8. You can open any .swf file in this player. The stand-alone player can be found in the Macromedia/Flash 8/Players/Release folder (Windows) or the Macromedia Flash 8:Players:Release folder (Mac) on the volume where you installed Flash MX 2004.

  • Projector: A projector is an executable copy of your movie that doesn't need an additional player or plug-in to be viewed. It's essentially a movie contained within the stand-alone player. The projector is ideal for distribution of Flash applications on CD-ROMs or DVD-ROMs. Figure 23-1 shows a Flash movie played as a Projector.

image from book
Figure 23-1: A movie playing as a projector

For the sake of simplicity, we refer to both projectors and movies played in the stand-alone Flash Player as stand-alones in this discussion. Because both the projector and stand-alone player have similar properties and limitations, you can apply everything discussed here to either one you choose to use.

Note 

Due to the differences in operating systems, Flash stand-alones on the Mac have the application menu listed in the system bar at the top of the Macintosh desktop area. On Windows, the application menu bar is part of the stand-alone window, as shown in Figure 23-1.

Creating a Projector

When you have finished producing a Flash movie, it's fairly simple to turn it into a projector. You have two ways to create a stand-alone projector. Turning your Flash movies into Flash Player 8 stand-alone projectors typically adds 1.47 MB (Windows projectors) or 2 MB (Mac projectors) to the final file size. If you create a Mac projector from the Windows version of Flash MX 2004, the projector will add about 2.9 MB to the size of the .hqx file.

Note 

As each new version of Flash is released, the projector size will likely increase. Flash 4 projectors added 280 KB (316 KB Mac) to a movie's file size, Flash 5 added 368 KB (500 KB Mac) to the file size, Flash MX added 800K (1 MB Mac) to a Flash movie's file size, and Flash MX 2004 added 973 KB (1.3 MB Mac) to the movie's size. As the Flash Player's features are expanded, we'll likely see the size of the player continue to increase with each release of Flash.

Method 1: Using the Publish Command

The simplest way to make a Flash projector file is to use the Publish feature of Flash 8. In three short steps, you can have a stand-alone Flash movie presentation.

  1. Choose File ð Publish Settings from the application menu.

  2. When the Publish Settings dialog box opens, select the Formats tab and check the projector formats. Publish both Windows and Macintosh projectors using this method. Figure 23-2 shows the Publish Settings dialog box with the appropriate formats selected.

  3. Click the Publish button in the Publish Settings dialog box, and your Flash movie will be published in all of the formats (for example, .swf, .gif, .jpg, and projector formats) specified with Publish Settings.

image from book
Figure 23-2: Select the projector formats in the Publish Settings dialog box.

Method 2: Using the Stand-Alone Flash Player

You can also create a Flash projector file using the stand-alone Flash Player executable file that ships with Flash 8. You can find the stand-alone Flash Player in the Players/Release folder of the Flash 8 application folder.

Note 

If you use this method to create a projector, you can make a projector for the current platform only. Thus, if you are using the Windows version of the stand-alone Flash Player, you can create a Windows projector only.

  1. Export your Flash movie as an .swf file using File ð Export Movie. Alternatively, you can use the Publish feature to create the .swf file.

  2. Open the exported Flash movie file (.swf) in the stand-alone Flash Player.

  3. Choose File ð Create Projector from the stand-alone player's application menu, as shown in Figure 23-3.

  4. When the Save As dialog box opens, name the Projector and save it.

image from book
Figure 23-3: Choose File ð Create Projector from the stand-alone player menu.

Tip 

If your movie is set to play at full screen (see fscommand coverage later in this chapter), press the Esc key to make the stand-alone player menu bar appear. If the Flash movie is set to play without the application menu, you should use the Publish method to create a projector.

Distribution and Licensing

Distribution of stand-alone projectors or the Flash Player is free; you don't have to buy a license to distribute either the stand-alone Flash Player or projector. However, according to Macromedia, you need to follow specific guidelines for distributed Flash Players and projectors. You can download the runtime license agreement and Macromedia logos from the Macromedia Web site. For more information, check out www.macromedia.com/support/shockwave/info/licensing/.

Distribution on CD-ROM or DVD-ROM

The Flash platform has become increasingly popular for use on multimedia CD-ROMs or DVD-ROMs, especially as embedded .swf files in larger Macromedia Director projectors. Stand-alones can be used as front-ends for installations, splash screens for other programs, or even as complete applications. When you combine the good looks of a Flash interface with a few fscommand actions (see the next section for more information) and put them together on a CD-ROM (or DVD-ROM) that's programmed to start automatically on insertion, you have a first-class product.

Caution 

As a general rule, don't try to send projector files (.exe files) as attachments to e-mail messages. Most current e-mail clients, such as Microsoft Outlook, will not allow you to open an e-mail containing an executable file, protecting you against computer-virus infections.

fscommand Actions

The fscommand actions can be used to provide greater functionality to your stand-alones. These actions can turn a simple Flash movie into something spectacular! When they're combined with additional scripting and executables, you can make fully functional applications. Table 23-1 lists fscommand actions for stand-alones.

Table 23-1: fscommand Actions for Stand-Alones

FSCommand

Arguments

Function

"fullscreen"

"true" or "false"

Expands or contracts the view of the projector. The argument "true" sets the stand-alone to full-screen mode, without a title bar. The argument "false" sets it to the size specified by the Movie Properties.

"allowscale"

"true" or "false"

Allows for scaling of the movie. The argument "false" sets the movie to the size specified by the Document Properties dialog box (Modify ð Document). This doesn't actually keep the stand-alone from being resized; it only keeps the movie inside of it from being scaled.

"showmenu"

"true" or "false"

Toggles the menu bar and the right-click/Control+click menu. The argument "true" enables them; "false" turns them both off.

"trapallkeys"

"true" or "false"

Captures all key presses, including those that would normally control the player. If you have turned off the menu with the "showmenu" command, you will need to manually create a "quit" command to exit the player or projector.

"exec"

Path to executable (BAT, COM, EXE, and so on)

Opens an executable from within the stand-alone player. The application opens in front of the projector.

"quit"

No argument

Closes the stand-alone.

When an fscommand action is added in the Actions panel, you can access stand-alone-specific commands from Script Assist mode, as shown in Figure 23-4. Refer to Chapter 18, "Understanding Actions and Event Handlers," for more information on adding actions to Flash frames or buttons.

image from book
Figure 23-4: If you turn on Script Assist for an fscommand() action, you can choose from a list of commands.

Note 

Flash 5 offered an undocumented save command for use in fscommand actions. This command enabled a Windows projector to save variables from the Flash movie to a text (.txt) file on the end-user's system. Although Flash MX, Flash MX 2004, and Flash 8 no longer offer this feature, you can combine Flash movies with Director projectors and the FileIO Xtra to write text files on either Mac or Windows systems. Even better, Flash ActionScript has a SharedObject class that enables local storage of information from Flash movies. We demonstrate the use of the SharedObject class in Chapter 31, "Creating a Game in Flash."

Caution 

Make sure you list the commands and arguments for fscommand actions as strings, not as expressions (unless you purposely want to refer to an ActionScript variable). If you do not encapsulate the command and argument in quotes, as in fscommand("allowscale", " true");, it may not be interpreted by the stand-alone. Also, in order to use Script Assist with an fscommand() action, you must provide two arguments with the function, such as fscommand("allowscale", "true");. Otherwise, Script Assist mode returns an error.

You can also open HTML documents (even ones stored on a distributed CD-ROM) in the system's default Web browser by using the getURL() action. The following getURL() action opens a file named start.html that's in the same location as the stand-alone movie:

 getURL("start.html"); 

Or, alternatively, you can display remote content in the Web browser by specifying absolute URLs, such as:

 getURL("http://www.theMakers.com/index.html"); 

Although fscommand actions are relatively simple to use, Flash ActionScript has a Stage object that enables you to control many of the same features of the Flash Player. Refer to the coverage of the Stage object in the Flash ActionScript Bible series by Robert Reinhardt and Joey Lott (Wiley).

Using a Behavior to Toggle the Screen Mode

One of the behaviors included with Flash 8 is the Toggle Full Screen mode behavior, to be used for Flash stand-alone projectors. When you run a Flash projector, you can have the projector take over the user's desktop, getting rid of the application window and menus. This mode is similar to a presentation mode for a PowerPoint file or a QuickTime or Windows Media movie. In the following steps, you learn how to quickly apply this behavior to a Button component.

  1. In Flash 8, create a new document.

  2. Rename Layer 1 to button.

  3. Open the Buttons library by choosing Window ð Common Libraries ð Buttons. In this library, open the Component Buttons folder. With frame 1 of the button layer selected, drag an instance of the pill button component from the library to the Stage. Place the instance in the upper-left corner of the Stage.

  4. Select the new instance on the Stage. In the Property inspector, name the instance cpbToggle. In the Parameters tab of the inspector, type Toggle Screen in the Label field and select the auto-width check box above the field, as shown in Figure 23-5.

  5. With the instance selected on the Stage, open the Behaviors panel (Shift+F3). Click the Add Behavior (+) button in the panel, and choose Projector ð Toggle Full Screen mode. Flash 8 presents a confirmation dialog box, telling you what the behavior does (see Figure 23-6). Click OK.

  6. Save your Flash document as projector_behavior.fla.

  7. Choose File ð Publish Settings to open the Publish Settings dialog box. In the Formats tab, choose Windows Projector and Macintosh Projector, as shown in Figure 23-7. Click the Publish button to create the projector files; then click OK to close the dialog box.

  8. On your desktop, browse to the location where you saved the Flash document in Step 6. Double-click the projector file that corresponds to the operating system you are using. For example, if you're using Windows, double-click the projector_behavior.exe file. If you're on a Mac, double-click the projector_behavior application file.

  9. When the projector starts, the Flash movie should be running in a normal application window. Click the Toggle Screen button to make the movie run in full-screen mode. When you click the button again, the movie should revert to the application window mode.

image from book
Figure 23-5: The settings for the pill button instance

image from book
Figure 23-6: The Toggle Full Screen mode behavior dialog box

image from book
Figure 23-7: The Publish Settings dialog box

On the CD-ROM 

You can find the completed Flash document, projector_behavior.fla, in the ch23 folder of this book's CD-ROM.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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