ie8 error object required external interface callback fix

going from actionscript 2 a2 to as3 can be tough, and this forum will show the road to as3. as3 is not best suited for small animation or web projects, and is in someways a red headed stepchild of java and c++. But, it still has a purpose, for now.
Post Reply
darknkreepy3#
Site Admin
Posts: 247
Joined: Tue Oct 27, 2009 9:33 pm

ie8 error object required external interface callback fix

Post by darknkreepy3# »

I traced a bug in internet explorer 8 where for no reason an error:

Code: Select all

object required line:48 char:3
would come up no matter how I edited my javascript, php, or html. It wasn't present at all, a ghost bug. I thought it might be something flash built, and the code:

Code: Select all

import flash.external.*
flash.system.Security.allowDomain("*")
//
function changeSize(sW,sH):void
	{
	tF_js.text="changeSize("+sW+":"+sH+")";	
	}
ExternalInterface.addCallback("changeSize",changeSize);
import flash.external.* was fine, but the .addCallback kept throwing that crazy ie8 error, so I added an .allDomain for all, or * surrounded by double quotes. Voila, the hidden javascript running in the compiled swf that is embedded with the object tag now works without any error.

Image
Post Reply