Lemme start off by saying UGH.

Ok, so I’ve been trying to get swfobject to work with ExternalInterface. The swf and the html are located on the same domain (locally - not running on a server). Upon calling the js function that should have called my as function, it kept giving me the error “Error calling method on NPObject!”.

Anyway, there is a fair amount of documentation on google as to what problems you might be having if you get this error (summarized by this guy reasonably well) but my case didn’t fit any of those criteria.

My code looked like this (latching onto the creationComplete of the Application):

creationComplete="ExternalInterface.addCallback('alert',Alert.show)"

Apparently this is bad. It doesn’t like that I’m passing “Alert.show”.

It works if I do this:

creationComplete="ExternalInterface.addCallback('alert',stupidstupid)"

where I define “stupidstupid” in the script portion of the Application.

Anyway, the quick summary is, don’t use Alert.show (other similar calls probably don’t work as well…for reasons unclear to me at the moment).

In my context, there were no cross domain considerations since it was all local.

*shakes fist*

Tags: ,