Home / Articles / Adobe Flash / External Communications with Flash 8: How to Use the ExternalInterface

External Communications with Flash 8: How to Use the ExternalInterface

Article Description

Kris Hadlock explores the use of the ExternalInterface class in Flash 8. With ExternalInterface, you can build robust object-oriented Flash applications that can be connected to the outside world and tied to databases and other server-side processes.

Like this article? We recommend

Macromedia Flash 8: Training from the Source

Macromedia Flash 8: Training from the Source

$44.99

The Container

In this project, the container is an HTML page that contains the embedded Flash object and JavaScript. The most important items to keep in mind are making sure that the embedded Flash object has an id attribute in the object tag and a name attribute in the embed tag. The following example highlights these attributes:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
  width="550"
  height="400"
  id="chart">
  <param name="movie" value="flash/chart.swf" />
  <param name="quality" value="high" />
  <embed src="flash/chart.swf"
    quality="high"
    width="550"
    height="400"
    name="chart"
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

The attributes are used by the included JavaScript to make a connection to the Flash movie object and send calls to the methods that it contains. The object id tag is used as a reference by Internet Explorer (IE) and the embed tag’s name attribute is used by the other browsers.

4. The JavaScript Connection | Next Section Previous Section