object doesn't support this property or method
Hi all,
I'm testing AS3 calling Javascript. It works in FF but not in IE8. I'm suspecting is a version problem but not sure.Can someone take a look? TIA -s
Here is my environment:
OS: Win7 Pro 64bit.
CS4 installed.
then Flash player updated to 11.1 (no touch to the CS4 Flash installation dirs).
Here is the AS3 code:
import flash.external.ExternalInterface;
flash.system.Security.allowDomain("*");
startTest();
function f0():Boolean {
ExternalInterface.call("ff1");
return true;
}
function startTest():void {
if (ExternalInterface.available) {
try {
ExternalInterface.addCallback("f100", f0);
} catch (error:Error) {
trace("An Error occurred: " + error.message + "\n");
}}}
Here is Javascipt part:
<script type="text/javascript">
function ff1() { alert("From AS") }
function f101() { window.setTimeout(f100, 2000) }
function f100(){
var a=document.getElementById("fltest");
a.f100() // got error message here
}
window.onload= f101;
</script>
</head>
<body>
<div id="test"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve rsion=10,0,0,0" width="215" height="318" id="fltest" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="test.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /> <embed src="pet.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="215" height="318" name="fltest" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</div>
