Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>THANK YOU VERY MUCH!</strong></p> <p>I stumbled upon this answer by total chance after wasting a couple of hours trying to get SM2 SWF embed to work. </p> <p>I'm going to "revive" this to add a few keywords so Google indexes this answer... Maybe the next person trying to embed SoundManager2 SWF in a cross-domain environment gets it done a little quicker than I did :)</p> <p>The error I was getting upon flash initialization was: <strong>Error calling method on NPObject</strong></p> <p>On the JS side, this was the code that broke everything:</p> <pre><code>// attempt to talk to Flash flash._externalInterfaceTest(false); &lt;- KABOOM! </code></pre> <p>NPObject errors might have many meanings, but more often than not (in our environment) it means: <em>You're trying to call the ExternalInterface through JS on a flash movie hosted on a different domain.</em></p> <p>After a while I popped open SoundManager2 ActionScript 3 code and saw this:</p> <pre><code>public var allow_xdomain_scripting:Boolean = false; public var xdomain:String = "*"; [... other stuff ...] if (allow_xdomain_scripting &amp;&amp; xdomain) { Security.allowDomain(xdomain); version_as += ' - cross-domain enabled'; } </code></pre> <p>Of course that means that the movie that you might be using (no matter if it's debug or not) will not be accessible from a different domain (a CDN, or whatever).</p> <p>The solution was –as stated in @amlutz160's answer– <strong>to use the files contained in swf/soundmanager2_flash_xdomain.zip, which are compiled with allow_xdomain_scripting = true</strong>.</p> <p>Posting this is quite embarrassing, and the solution <strong>is obvious</strong>, but I lost quite a bit of time with this and AFAIK the contents of that mysterious zip file are not documented anywhere (I found a <a href="https://getsatisfaction.com/schillmania/topics/soundmanager2_and_crossdomain" rel="nofollow">tangential mention on SM2 forums</a>).</p> <p>PS: I'm forwarding this answer to <a href="https://twitter.com/schill" rel="nofollow">Scott Schiller</a> so maybe he can update SoundManager2 docs a little bit :P</p> <p>Regards!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload