"briandunnington said on May 9, 2006 at 4:56 PM : "
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002200.html
Place the following script before the flash object reference and be sure to change ShockwaveFlash1 to your flash file name:
<script type="text/javascript">
function ExternalInterfaceManager()
{
this.registerMovie = function(movieName)
{
if(!window.fakeMovies) window.fakeMovies = new Array();
window.fakeMovies[window.fakeMovies.length] = movieName;
}
this.initialize = function()
{
if(document.all)
{
if(window.fakeMovies)
{
for(i=0;i
window[window.fakeMovies[i]] = new Object();
}
window.onload = initializeExternalInterface;
}
}
}
}
function initializeExternalInterface()
{
for(i=0;i
var movieName = window.fakeMovies[i];
var fakeMovie = window[movieName];
var realMovie = document.getElementById(movieName);
for(var method in fakeMovie)
{
realMovie[method] = function() {flashFunction = "<invoke name=\"" + method.toString() + "\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments, 0) + "</invoke>";this.CallFunction(flashFunction);}
}
window[movieName] = realMovie;
}
}
</script>
<script type="">
var eim = new ExternalInterfaceManager();
eim.registerMovie("ShockwaveFlash1");
eim.registerMovie("ShockwaveFlash2");
eim.initialize();
</script>
If you have any tips you would like to share please email them to me at chrisw_88@hotmail.com