• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Chapter 27. Browser Scripting

by Darrel Plant

In this chapter

Conversing with the Browser Environment

Understanding the FSCommand System

Troubleshooting Browser Scripting

Did You Know?

With ActionScript and the capability to load new pages into the browser with the GetURL action, a Flash movie appears to be a fully independent device capable of handling every user and server interaction imaginable. For all its wonder, however, a Flash movie is never truly independent. Incapable of playing on its own, the Flash movie requires either the Flash player application or a browser equipped with an appropriate plug-in (a plug-in essentially gives the browser the capability to be a player application).

These environments are called host applications—they tell a Flash movie how and when to play (either via the menu controls of the player or the OBJECT/EMBED parameters within the HTML code read by the browser). Without a host application, a Flash movie is dead in the water.

Sooner or later you might want to have the Flash movie communicate with its host application, perhaps to modify the way the movie plays or to instruct the host application to do something (within its realm of capability, of course). If the Flash movie is intended to play as a standalone, for instance, the Flash movie might want to instruct its host application (in this case, the Flash player) to play full screen or to quit (see Chapter 21, "Controlling the Player").

This communication can occur in a number of ways, but the customary intermediary is a system called FSCommand. FSCommand is made up of a set of commands and methods universally understood by both the Flash movie and its variety of host applications. A Flash movie can pass a select number of these commands to the Flash player or can both pass and receive instructions to and from a browser environment. An alternative to the somewhat constrained system of FSCommand is to have the Flash movie converse directly with the browser environment via JavaScript.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint