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

Flash and JavaScript

Scripting Flash movies in the browser follows the same rules as scripting any plugin media type (see Chapter 19 for more on this). Whenever you want Flash movies to talk to the browser, or the browser to give commands to the Flash Player, you use Flash ActionScript to send JavaScript instructions, or JavaScript to send ActionScript code.

Scripting In: Using JavaScript to Control Flash

A variety of JavaScript commands exist for communicating with the Flash Player, in its plugin and its ActiveX form. Table 20.6 lists some of the most commonly used of them. As you can see from examining the figure, it’s possible to send the Flash movie to a certain frame in its timeline; to start and stop playback; and even to control embedded movie clips by setting their properties and controlling their timelines. (The more you know about Flash authoring, the more useful this information will be to you.) Before relying on any of these commands, remember that although ActiveX media controls support extensive scripting for IE/Windows, no commands given to media objects will work within IE/Mac. Netscape 6 also has some difficulties passing commands to Flash movies.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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