Cross-browser JavaScript to ActionScript communication: These HTML buttons communicate with the Flash elements in the page.

target movie 2 target movie 1 target 1 thru 3 clear all

alt filler for flash object alt filler for flash object
This version (0.9.0) is compatible with:

X Library style documentation:

xFlaCom(ele, message)

Send script message to Flash plugin. Depends on file xFlaCom.swf which must be in same directory as x_fla.js (otherwise change xFlaPath variable in x_fla.js). Flash object markup requires Param tag with name flashvars and value "movieid=ele". To communicate from the plugin to the document use getUrl("javascript:functionName(arguments)");

Uses: xGetElementById(), xGetElementByTagName(), xDef(), xCreateElement(), xInnerHtml(),

File: x_fla.js

See: Flash Communication

Two working methods for object/embed markup:
valid xhtml (cannot stream without workaround):

<object id="mx3" type="application/x-shockwave-flash" data="src/movie.swf" width="300" height="300">
<param name="movie" value="src/movie.swf" />
<param name="FlashVars" value="movieid=mx3" />
<img src="alt2flash.gif" width="200" height="100" alt="alt filler for flash object" />
</object>

common generated markup:

<object id="mx1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width="300" height="300">
<param name="movie" value="src/movie.swf" />
<param name="flashvars" value="movieid=mx1" />
<param name="quality" value="high" />
<embed src="src/movie.swf" id="mx1" quality="high" flashvars="movieid=mx1"
pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"
width="300" height="300"></embed>
</object> 
Bold portions are required (for each respective technique).

Please report problems or revisions to these scripts to Jim Montgomery (xFlaCom2004@jimmont.com).

Download Source

These scripts based on prior work of MustardLabs and Michael Foster.

Miscellaneous notes: