4 Replies Latest reply on Nov 13, 2007 4:17 PM by nak5ive

    Security Sandbox - Error #2122

    nak5ive
      this is going to be a relatively common occurance for those interested in dynamic drawing applications with AS3, specifically Spectrum.computeSpectrum().

      i am no exception.

      I have created a small jukebox in AS3 with a visualization using the computeSpectrum() method. I at first was receiving sandbox violations requesting a policy file before it would download the mp3 needed for playback. I looked into this matter and found a solution to add a SoundLoaderContext object to the Sound.load() method that told the sound object to check for a policy file before downloading. here is my challenge:

      i have a tab in firefox open to youtube, on a video's page. in another tab, my website with jukebox (including visualization). when the jukebox attemps to compute the spectrum, i receive Error #2122 (more specifically: SecurityError: Error #2122: Security sandbox violation: SoundMixer.computeSpectrum: http://kingthief.com/assets/flash/jukebox.swf cannot access http://sjc-v28.sjc.youtube.com/get_video?video_id=iRHDuMkgZ10. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.)

      these warnings prevent spectrum from operating and jukebox functionality until warning is dismissed.

      my question: why would i get sandbox violations in the jukebox for a flash app in a different website, in a different tab? i know that flash 9 is now a VM so they must be inherently linked, but my warning indicates i'm trying to read a policy file from a site it is not even connecting to (or requesting from)

      i'm completely stumped. help?
        • 1. Re: Security Sandbox - Error #2122
          dfm_
          no help can be seen in Adobe forums ;)
          • 2. Re: Security Sandbox - Error #2122
            joeflashTO Level 1
            The Flash Player security sandbox can be quite a labyrinthian topic, which is probably why this thread has remained unanswered. Check out chapter 19 of Colin Moock's Essential ActionScript 3.0 book, he's done an excellent job of explaining the security sandbox better than I've seen anywhere.
            • 3. Re: Security Sandbox - Error #2122
              dfm_ Level 1
              hi I have make solution for this error here to see it
              [URL=" http://theflashblog-bg.com/index.php?p=40"
              please be sure to change the language if is needed.
              • 4. Re: Security Sandbox - Error #2122
                nak5ive Level 1
                dfm_
                while i do appreciate the information on loading data across different domains, it doesn't not solve this specific problem.

                i will reiterate that i was receiving sandbox error #2122, but i was NOT requesting data from an outside domain. all paths within my flash application were relative. i simply had two firefox tabs open...one with my flash app in it, and another on a youtube video page. Now, obviously it isn't specific to youtube. the "other" tab could be pointed to any site with a media player present and running on it.

                i tried to further investigate this bug, but eventually abandoned using the computeSpectrum() method all together.

                is it a flash player bug? a firefox issue? i have no idea.

                if the application is open and running by itself, it works like a charm. then try to also have youtube running, refresh my app, and voila... sandbox violation.

                i have still found no help. i hope someone at adobe reads this and submits a formal bug report.
                very annoying.