A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: SecurityError: Error #2123 BitmapData.draw

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    40

    SecurityError: Error #2123 BitmapData.draw

    Hello All,
    I am having an issue with using BitmapData.draw(stage). I am getting the following error:

    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access.

    Here is a portion of my code:

    var bd:BitmapData = new BitmapData(2800, 2100);
    bd.draw(stage);//this is where the error happens

    All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1.

    Let me know if I need to supply any more info.
    Thanks in advance!
    -Jake

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    That error is odd. It claims that you cannot access null, rather than any particular resource. Is stage null at the time you are calling that?

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    40
    I ran the following before draw(stage):

    if(stage == null){trace("null")}
    else{trace("not null")}

    it returned: "not null"

    I used this a few months ago, and it worked fine... Is there some Security change I can make?

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Is this going to run from a local filesystem or from a webserver when done?

    If it is supposed to be from a webserver, try testing that way. If local, you may want to redo it in AIR.

    Other than that, I don't know.

  5. #5
    Member
    Join Date
    Jul 2008
    Posts
    40
    Thanks for the response!

    AIR didn't work. It will be run locally only, never on the web.

    The only changes that occurred in between the function working was:

    1. A possible flash player security update...
    2. The use of compiled clips...
    3. Replacing a bunch of arrays with vectors...
    4. Maybe I.T. messing with my computer security settings...

    ... I'm basically clueless, but I will continue debugging.

    Any other help would be greatly appreciated.

    Thanks,
    Jake

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center