3 Replies Latest reply on Jul 9, 2008 10:53 AM by jasongardner

    Sandbox Error 2123

    jasongardner
      Hope somebody can help :X
      I've been working on a UI Automation and Testing framework for my AIR apps. I have an AIR application (TestRunner) which loads up another air application as a child component and manipulates properties, fires events at it, etc. and then grabs screenshots (actually bitmapdata.draw) and compares to bitmapdata that is already stored with the test's source.

      This has all been working great so far until I got to a particular area of the child application, which involves video and images. These videos and images are loaded from a content folder within the test application's directory and referred to as such (app:/content/...). At certain points within my test I get the exception:

      SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: app:/TestRunner.swf cannot access unknown URL. No policy files granted access. at flash.display::BitmapData/draw()

      To be sure that it was not a problem between SWFs, I've compiled the application-to-be-tested and the tester app into one SWF. To clarify, the build looks like this:

      tests/
      TestRunner.swf
      TestRunner-app.xml
      bitmapData/
      ...
      content/
      ...

      I've googled this to death and tried everything I can think of (placing policy files everywhere, compiling the tester and the testee into a single SWF, app: vs. nativePath). I'm still struggling to understand why an AIR app, that can access the file system until the cows come home, can't take a screenprint of a video that was loaded from the application's directory.

      It's the "unknown URL" that really gets me. Why can't it resolve?

      I should note that I'm running the application using ADL. This is sort of a requirement, as I'm going to need these tests to be run by cruisecontrol and I can't have the build installing these applications on every check-in.

      Anybody seen this (#2123 error when bitmapdata.draw-ing an image/video that is loaded locally)? Anyone with access to the flash source code that can tell me why I would see "unknown URL"?

      Any help is appreciated. Thanks