views:

544

answers:

2

I'm using flex builder to compile my SWF. Im using mp3's on my local machine and computeSpectrum() to analyze the mp3.

After playing for 20secs, my computeSpectrum stops returning values, instead, it starts returning this error:

SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum: file:///C|/Documents%20and%20Settings/Kasper/My%20Documents/Flex%20Builder%203/Soundanalizer/bin%2Ddebug/Soundanalizer.swf cannot access . This may be worked around by calling Security.allowDomain.

If I compile with flash, it doesn't throw this error :/

A: 

Issues I've had with computeSpectrum in the past were caused by the global way Flash checks the audio sandbox, meaning other unrelated Flash content open in the browser (e.g. YouTube) is treated as if your swf was trying to load it - this means that if you run your app and then open YouTube you will get an error.

Could this be the cause?

Iain
no, that's not it, just closed all possibly inter veining programs, browsers and so-on. but no dice.but i read somewhere that it perhaps works when i edit a network setting in mxmlc, any idea how to do this ?
Kasper
+1  A: 

The flash player thinks it's trying to open a local file from a website. This is ignored if you run it from the flash ide. It should also work as it is if you upload it to a webserver.

To be able to test locally add access to your swf (or the entire project folder) using the security tab on http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

Antti
Makes sense, at it runs when compiled from Flash IDE. But I prefer to be able to compile with Flex Builder - do you know if there is a workaround or a setting mxmlc to make this work?Thanks again
Kasper