Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: Error calling method on NPObject

NPObject is an "interface" to any "foreign" code exposed through the browser (foreign, as in foreign to JavaScript, otherwise it may be browser's own objects, like the global window object for example). The embedded Flash plugin would certainly implement this "interface" (so the browser sees it as just another NPObject).

When you call a method on that object, there are several function that wrap that call serializing the data passed to the object and back to browser's runtime. It is difficult to tell for certain what exactly didn't work, but some common reasons would include:

  1. The plugin does not expose (or did not register yet) a method with the name you are trying to call.
  2. The plugin was embedded in a way that crosscripting is not allowed (the limitations may be on both sides, Flash requires that the call comes from a trusted domain and you may restrict the plugin from communicating with environment through the settings in the object tag.
  3. An error thrown in the plugin's code invoked through JavaScript - I'm not sure that would be the same error, but it is very much likely.

I was getting the same error message. The problem only occurred when Flash made an ExternalInterface call that returned after Flash crashed (for what reason whatsoever). The fix I implemented was: Check if the Flash object is still up and running and if the callback is still a function of that object.