remember to test your movie on the server. It doesn't work when you test it
locally.
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Jon Robert
Sent: Wed 4/19/2006 5:59 PM
To: [email protected]
Cc:
Subject: [Flashcoders] ExternalInterface
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>
/* +++++++++++++++++++++++++++++++++++++++++++++++++++ */
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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