Security sandbox violation? How come!
I've received a few error reports on a for-fun-only flash thing/experiment/joke I did some time ago, the next captcha generation for myspace forms.
At first I thought it had been my fault, due to my inexperience in flash, but after having been working more time with sounds in flash, I found the problem is not in my code but in Flash's internals. For some reason, if you're calling, for example, computeSpectrum in one movie and at the same time there's another flash movie being executed and playing any type of media in another tab, your movie will begin to trigger Security sandbox violation errors.
It seems to happen because the player doesn't distinguish between different movies, and treats all the sounds as if they belonged to the same soundspace (like a namespace, but for sounds :D), hence it tries to mix them all together and process the soundSpectrum of this global mix. Obviously, they don't belong to the same domain, and that's why you'll soon get errors.
And you might wonder what's going wrong, because you've got your policy files and everything sorted out, everything seems fine but it's not when you try to access global sound stuff. Hopefully now you know why (although you can't do anything about that).
I'm not sure if this should be an expected behaviour or they just didn't think that we could execute several flash movies in different tabs. Obviously, this only shows up if you're using the debug version of the player. In any other case, all these errors are lost in a flash log file which is hidden somewhere in your hard disk.
Anybody knows of any solution or work around? It seems to be happening to a few more people as well.


Jan
20071109
Hi
I had the same problems, and the only solution i found was to use a try/catch when getting the bytearray
try {
SoundMixer.computeSpectrum( spectrum );
} catch ( e:* ) {
// do somethin else
}
This will prevent the dirty violation errors, but you still cant use the byteArray :-(
jan
sole
20071109
hi!
Yes, you can hide the error like that, and anyway only people with debug flash players would see it anyway, but the problem is still there because flash is mixing everything in the same 'soundmixer'.
I can't think of any solution actually :-/
Ryan Magnon
20071120
In your global security settings that comes up when you hit the settings button, add the path to any trusted swfs that try to load content from the internet or where ever. When the global security movie comes up it'll show the path to your file in a "hint" input field. A mistake I made was copying that directly…. It added %20 to replace the spaces in my file path. Once I removed those, and replaced them with spaces, it worked. Hope this works in your scenario. Mine was a little different, but the same principle I think.
sole
20071121
Well it may work but that it's not fixing the problem, only the effects of the problem. Adobe should rethink the way the Sound is mixed.
It's like sharing the same stage for every flash movie in your browser. Don't you think that idea seems terrible? Well, all the flash movies in your browser are sharing the sound mixer.
Superkrut » Blog Archive » computeSpectrum exploit
20071209
[...] posts on internet explains that you could use try catch to avoid the debug dialog, that's not [...]
Symmetri Developer Blog :: Weird security problems with SoundMixer.computeSpectrum() :: February :: 2008
20080214
[...] movies within the same browser process to access sound files for manipulation simultaneously - this webpage suggests that we are probably looking at a Flash Player bug for an explanation of that one. I have [...]