EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Sending Messages to and from Flash Player

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Sending messages to and from Flash Player 663
Sending messages to and from
Flash Player
To send messages from a SWF file to its host environment (for example, a web browser, a
Macromedia Director movie, or the stand-alone Flash Player), you can use the
fscommand()
function.This function lets you extend your SWF file by using the capabilities of the host. For
example, you could pass an
fscommand() function to a JavaScript function in an HTML page
that opens a new browser window with specific properties.
To control a SWF file in Flash Player from web browser scripting languages such as JavaScript,
VBScript, and Microsoft JScript, you can use Flash Player methods—functions that send
messages from a host environment to the SWF file. For example, you could have a link in an
HTML page that sends your SWF file to a specific frame.
For more information, see the following topics:
“Using the fscommand() function” on page 663
About using JavaScript to control Flash applications” on page 666
About Flash Player methods” on page 666
Using the fscommand() function
You use the fscommand() function to send a message to whichever program is hosting
Flash Player, such as a web browser.
The fscommand() function has two parameters: command and arguments. To send a message
to the stand-alone version of Flash Player, you must use predefined commands and
arguments. For example, the following event handler sets the stand-alone player to scale the
SWF file to the full monitor screen size when the button is released:
my_btn.onRelease = function() {
fscommand("fullscreen", true);
};
NOTE
The External API is a replacement for fscommand() in Flash 8 for interoperating with a
HTML page or a container application. The External API offers more robust functionality
than
fscommand() in this situation. For more information, see “About the External API”
on page 667.
NOTE
Using the fscommand() to call JavaScript does not work on the Safari or Internet Explorer
browsers for the Macintosh.

Table of Contents

Related product manuals