in black and white
Main menu
Share a book About us Home
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics

Flash MX action script bible - Reinhardt R.

Reinhardt R. Flash MX action script bible - Wiley & sons , 2004. - 987 p.
ISBN: 0-7645-4354-7
Download (direct link): macractionscriptbiblefeb2004.pdf
Previous << 1 .. 363 364 365 366 367 368 < 369 > 370 371 372 373 374 375 .. 427 >> Next

Chapter 33 ♦ Scripting for the Flash Stand-Alone Player
on (release)! closeMovie();
9. You’re ready to test the Flash movie as a projector. But first, save the Flash document as projector_100.fla. Then go to the File O Publish Settings dialog box, and make sure that you check either the Windows or Macintosh Projector options in the Formats tab. Click the Publish button in the dialog box, or close the box and choose File O Publish. Go to the folder where you saved the FLA file to see the projector file. Doubleclick the projector file, and test your buttons. You should be able to switch the view of the projector (as shown in Figures 33-1 and 33-2) or access the warning box when you click the quit button (as shown in Figure 33-3).
You can further modify the resize() and closeMovie() methods to do other things to your Flash movie as you add content to the presentation. Methods allow you to assign simple statements to interactive controls (such as your control buttons) and continually add more ActionScript without having to access the original controls — simply add the code to the functions.
Note Some third-party projector utilities (mentioned later in this chapter) enable you to strip the
outer default window and title bar from projectors.
/ Macromedia Flash Player 7 3s)Q
File View Control Help
n f rjjji iflnfS' g)[5)[x] ’

Figure 33-1: The projector in minimize (standard) view
Part IX ♦ Working with Flash in Other Environments
Figure 33-2: The projector in maximize (full-screen) view
/ Macr otnedia Flash Player 7
File View Control Help
r jktiuii'J'-'iul iiibli
A You are about to leave this application. Are you sure you want to quit? Yes 1 | No
Figure 33-3: The warning dialog box
Chapter 33 ♦ Scripting for the Flash Stand-Alone Player 805
Using fullscreen and allowscale to Matte a Movie
In this section, you slightly modify the ActionScript created in the previous example. For this incarnation, you simply set allowscale to "false" directly in the resize() method. This prevents the movie from expanding in size, but it enables the projector to take over the desktop.
1. Open the projector_100.fla file that you saved from the previous exercise, or open the same titled file from the ch33 folder of this book’s CD-ROM.
2. Select frame 1 of the actions layer and open the Actions panel. Adjust the resize() method with the bold line of code :
mcWinControl.resize = function(sType:String):Void { fscommandCallowscale", "false");
fscommand("fullscreen", sType);
3. Save your Flash document as projector_200.fla and publish a projector file. When you press the maximize button, your computer screen should resemble Figure 33-4.
Figure 33-4: A matted, full-screen Flash projector
Part IX ♦ Working with Flash in Other Environments
As mentioned earlier, you might not want to use the allowscale command with your Flash movies, especially if the movies contain intensive vector-graphic animations such as alpha tweens with several symbol instances. As you scale your Flash movies larger, you’re likely to notice performance issues such as choppy or slow playback.
Tip You can press the Esc key to force the projector back to the original window and size.
Preventing Access to the Desktop
The trapallkeys command enables a projector to prevent the keyboard from being used to access any default system or application options, such as Ctrl+Q or ^+Q to quit, Esc to resize, and so on. If you want to create Flash projectors for kiosk displays in public spaces, you can make sure that the user of the kiosk can’t access anything except that what you allow in the Flash movie.
You can modify projector_200.fla so that the projector will auto-open to full screen. You can also prevent the user from accessing Ctrl+Q or ^+Q to exit the movie. The only way the projector exits is when users press the close button.
You also need to turn off the right-click (Control-click on the Mac) menu for the Flash Player in order to prevent the user from controlling any other features in the Flash movie. If you aren’t aware of this menu, open the projector file from the last section. When you right-click (or Control-click on the Mac) the Flash movie stage, you should see the context menu shown in Figure 33-5.
/ Macromedia Flash Player 7 ‘ 3SJQ
File View Control Help
' :/XiIliTiVreft.)* tmU EJE1EM

Zoom In N
100% ✓ Show All
Quality ►
About Macromedia Flash Flayer 7...
L. J
Figure 33-5: By default, the Flash Player allows you to access view and playback commands by right-clicking (or Control-clicking on the Mac) the movie's stage.
Chapter 33 ♦ Scripting for the Flash Stand-Alone Player 807
You disable all of this menu’s features using the showmenu command in this exercise. Enough chatter; let’s get started!
With Flash Player 6 or higher projectors, you can use the Stage.showMenu property to control the context menu as well (see Chapter 20 for more information). In Flash Player 7 projectors, you can use the new ContextMenu class to create custom context menus and/or hide built-in context menu items as well (see Chapter 20). These classes enable you to control the context menu in or out of the stand-alone environment.
Previous << 1 .. 363 364 365 366 367 368 < 369 > 370 371 372 373 374 375 .. 427 >> Next