Name

fscommand( ) Global Function — send a message to the standalone Playeror to the Player’s host application

Availability

Flash 3 and later (enhanced in Flash 5 to include trapallkeys)

Synopsis

fscommand(command, arguments)

Arguments

command

A string passed to the host application, often the name of a JavaScript function.

arguments

A string passed to the host application, often an argument to the function named by command.

Description

With the fscommand( ) function, a Flash movie can communicate with the standalone Player or with the Player’s host application—the environment in which the Flash Player is running (e.g., a web browser or Macromedia Director). The fscommand( ) function is typically used in one of three ways:

  • To send one of a limited set of built-in commands to the standalone Flash Player

  • To send commands to a scripting language such as JavaScript or VBScript in a web browser

  • To communicate with Lingo in a Macromedia Director movie

When used with the standalone Player, fscommand( ) takes one of the built-in sets of command/argument pairs, as shown in Table 20.5.

Table 20-5. command/argument Pairs in Standalone Player

Command

Argument

Description

"allowscale"

"true" or "false"

When "false", prevents the contents of a movie from growing or shrinking in relation to the window size of the Player. "allowscale" is often used in combination with "fullscreen" to create a Projector that occupies the entire screen while maintaining the movie’s original size.

"exec"

"application_name" ...

Get ActionScript: The Definitive Guide 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.