THANK YOU VERY MUCH!
I stumbled upon this answer by total chance after wasting a couple of hours trying to get SM2 SWF embed to work.
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 :)
The error I was getting upon flash initialization was: Error calling method on NPObject
On the JS side, this was the code that broke everything:
// attempt to talk to Flash
flash._externalInterfaceTest(false); <- KABOOM!
NPObject errors might have many meanings, but more often than not (in our environment) it means: You're trying to call the ExternalInterface through JS on a flash movie hosted on a different domain.
After a while I popped open SoundManager2 ActionScript 3 code and saw this:
public var allow_xdomain_scripting:Boolean = false;
public var xdomain:String = "*";
[... other stuff ...]
if (allow_xdomain_scripting && xdomain) {
Security.allowDomain(xdomain);
version_as += ' - cross-domain enabled';
}
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).
The solution was –as stated in @amlutz160's answer– to use the files contained in swf/soundmanager2_flash_xdomain.zip, which are compiled with allow_xdomain_scripting = true.
Posting this is quite embarrassing, and the solution is obvious, 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 tangential mention on SM2 forums).
PS: I'm forwarding this answer to Scott Schiller so maybe he can update SoundManager2 docs a little bit :P
Regards!