Skip to main content
Participant
December 19, 2008
Question

SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum:

  • December 19, 2008
  • 4 replies
  • 7960 views
I'm running two flash items on one page, both have sound, and the AS3 swf uses computeSpectrum

I'm getting the following error message:

SecurityError: Error #2121: Security sandbox violation: SoundMixer.computeSpectrum: http://dev1.kbrcomm.com/OLA/soundSpectrum_rev2.swf cannot access http://dev1.kbrcomm.com/OLA/ICE_intro_rev9.swf. This may be worked around by calling Security.allowDomain.
at flash.media::SoundMixer$/computeSpectrum()
at soundSpectrum_rev5_fla::mc_6/loop()


Please advise.... http://dev1.kbrcomm.com/OLA

I should mention that the swf that is generating the errors is AS3 and the swf that is reported in the error message is AS2
This topic has been closed for replies.

4 replies

kglad
Community Expert
Community Expert
February 19, 2009
make sure your allowScriptAccess parameter is set to always.
kglad
Community Expert
Community Expert
December 19, 2008
there's no problem with computeSpectrum working with a sound playing via a loaded as2 swf.
Participant
February 19, 2009
Yes I too have received this error but it's when I load any flash video or music player in another tab in firefox, while my swf is still playing
Participant
December 19, 2008
there aren't any references to any other files..

but I thing that the soundSpectrum automatically 'reads' all audio events from the other swf and any other window......

here is the code from the swf

var s:Sound = new Sound(new URLRequest("Dynamic_Full_Track_64.mp3"));
/*s.play(0, 1000);*/

var ba:ByteArray = new ByteArray();

/*var square:Sprite = new Sprite();
addChild(square);*/



addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event):void
{
graphics.clear();
graphics.lineStyle(2, 0x5AA426);
graphics.moveTo(-1, 37);
SoundMixer.computeSpectrum(ba);
for(var i:uint=0; i<256; i++)
{
var num:Number = -ba.readFloat()*28 + 35;
graphics.lineTo(i*1.375, num);
}
}
kglad
Community Expert
Community Expert
December 19, 2008
what code in your as3 file is trying to access your as2 file?