Hi,

I'm trying to use the ExternalInterface class to trigger a flash function
from javascript. I've checked out some tutorials but can't get it to work.
Could someone troubleshoot the following code.

Thanks in advance,
JP

ACTIONSCRIPT CODE:
/* ++++++++++++++++++++++++++++++++++++++++++++++++++ */
import flash.external.ExternalInterface;

function stopMovie() {
  gotoAndStop(2);
}

ExternalInterface.addCallback("stopMovie", null, stopMovie);
/* +++++++++++++++++++++++++++++++++++++++++++++++++++ */


JAVASCRIPT CODE:
/* +++++++++++++++++++++++++++++++++++++++++++++++++++ */
<script language="JavaScript">
var flash;
window.onload = function() {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    flash = window.flashObject;
    alert(flash);
  }else {
    flash = window.document.flashObject;
    alert(flash);
  }
}

function goToFlash() {
    flash.stopMovie();
 }
</script>
/* +++++++++++++++++++++++++++++++++++++++++++++++++++ */


FORM BUTTON:
/* +++++++++++++++++++++++++++++++++++++++++++++++++++ */
<form name="flashForm">
<input type="Button" value="Go to flash" name="flashButton"
onclick="javascript:goToFlash();" style="width:100px;" />
</form>
/* +++++++++++++++++++++++++++++++++++++++++++++++++++ */
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to