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 .. 364 365 366 367 368 369 < 370 > 371 372 373 374 375 376 .. 427 >> Next

1. Open the projector_200.fla file that you made in the last section, or open the same file from the book’s CD-ROM.
2. Select frame 1 of the actions layer and open the Actions panel. Adjust the resize() method with the following bold code:
mcWinControl.resize = function(sType:String) { fscommandCallowscale", "true"); fscommandCfullscreen", "true");
With this modification, you set resize() to always expand the projector to full screen. This effectively disables the minimize and maximize buttons.
3. With this resize() modification, you will execute the resize() function as soon as frame 1 loads. Just after the last curly brace and semicolon of the closeMovie() method, type the following code:
4. Now add the fscommand() to disable the projector’s contextual menu. After the mcWinControl resize(); line from the last step, type:
fscommand("showmenu", "false");
Note The "showmenu" command works only in the projector environment. It will not restrict the
context menu in the plug-in (or Web browser) environment.
5. Finally, you tell the projector to capture all keypresses on the keyboard. After the line of code from Step 4, type:
fscommand("trapallkeys", "true");
6. Save your Flash document as projector_300.fla and publish a projector. Doubleclick the projector file. The movie should open in full-screen mode automatically. Try pressing Ctrl/^+Q to exit the projector. It doesn’t work, does it? Click the close button in the upper-right corner. By clicking the Yes button in the warning dialog box, you can quit the movie.
Although the trapallkeys command does capture most keypresses, it cannot prevent the user from pressing Ctrl+Alt+Del or Alt+F4 (Windows) or Option+^+Esc (Mac) to forcibly quit the application on a system level. Some third-party tools, such as Flash Jester’s Jugglor, can trap other keys. Refer to the listing at the end of this chapter for the URLs to such tools.
808 Part IX ♦ Working with Flash in Other Environments
On the - You can find the projector_300.fla document in the ch33 folder of this book's CD-ROM. CD-ROM
Executing Other Applications
Another feature of the Flash stand-alone is the capability to execute programs outside of the projector file. Using the exec command, you can specify another application file to be run concurrently with the Flash projector. In this way, you can use Flash projectors as front-ends to software installers. For this scenario, you include the software installer EXE (or application on the Mac) file on the same CD-ROM or floppy containing the projector. For security reasons, any and all files that you want to run must be located within a folder named fscommand. This folder must be in the same parent folder as the Flash projector file. For example, if you had a software installer named setup.exe in the fscommand folder, you could add the following ActionScript to an install button in the Flash projector:
on (release)!
fscommand("exec", "setup.exe");
The filename and path is relative to the fscommand folder. As such, you can use a forward-slash separator ( / ) to target files in sub-folders of the fscommand folder.
You can also create applets or scripts with your favorite programming language. You can create Visual Basic EXE files that can perform operations with other installed applications.
Web It's beyond the scope of this book to delve into other scripting languages such as Visual Basic,
Resource but you can find an excellent tutorial on the Web at
On the Mac, you can write AppleScript applets that can be executed from the Flash projector. However, the Flash Player (as a stand-alone) cannot be accessed via AppleScript. There are no AppleScript-defined objects within the Flash Player.
You cannot specify document filenames with the exec command. For example, fscommand("exec", "readme.doc"); does not launch WordPad or Microsoft Word on Windows.
Expanding the Potential of the Stand-Alone Projector
Several third-party software applications allow you to enhance the functionality of a Flash projector. Unfortunately for Mac users, these products are usually available only for Windows. These add-ons allow you to embed files such as video and PDF documents into Flash projectors. Following is a list of Web sites that offer Flash projector utilities:
Chapter 33 ♦ Scripting for the Flash Stand-Alone Player 809
♦ Most of these sites offer free downloadable trial versions of their software products.
We'd like to know what you thought about this chapter. Visit feedback to fill out an online form with your comments.
♦ You can publish self-running versions of Flash movies. These files are called projectors or stand-alones. You can also play SWF files in the Flash Player application that ships with the application.
Previous << 1 .. 364 365 366 367 368 369 < 370 > 371 372 373 374 375 376 .. 427 >> Next