Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6143077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:28:31+00:00 2026-05-23T18:28:31+00:00

Since i’m having some issues with a sandbox here, i’m looking for a little

  • 0

Since i’m having some issues with a sandbox here, i’m looking for a little workaround that should work to proxify the assets loaded by a remote swf.

Currently after loading a remote swf, and trying to draw a bitmap i get the following error:

Security sandbox violation: BitmapData.draw: http://urlhere cannot access http://remotehost/clothes/bg/bg_10438411_bg.swf. This may be worked around by calling Security.allowDomain.

Now, i want to see if it’s possible to catch & change the swf’s that the remote swf loads. So i can load them through a php file and then into the swf instead. Basically editing the URL that it loads the swf from.. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:28:31+00:00Added an answer on May 23, 2026 at 6:28 pm

    It looks like you’re trying to draw a snapshot of a loaded swf using BitmapData.draw().
    You will either need a crossdomain.xml on the server holding the swf you’re loading, either proxy it through a server side script.

    If you have a crossdomain.xml, you can use pass a LoaderContext as the second parameter of Loader’s load() method, explicitly requesting crossdomain checking.
    If the security requirements are not met, a SecurityErrorEvent will be dispatched.
    Also, you should catch the SecurityError thrown when calling BitmapData’s draw() method and use the loaderInfo’s url to change it and use it however you see fit:

    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityError);
    loader.load(new URLRequest('yoursite.com/yourfile.swf'),new LoaderContext(true));
    
    function completeHandler(event:Event):void{
        var clone:BitmapData = new BitmapData(1,1);//create a small bitmap to try and draw into
        try{//draw the contents
            clone.draw(event.target.content);
        }catch(error:SecurityError){//expect security error
            trace('SecurityError while loading',event.target.url,'details\n',error.message);    
        }
    }
    function securityError(event:SecurityErrorEvent):void{
        trace(event.target.url,event);
    }
    

    You can also add listeners for IOErrorEvent and HTTPStatusEvent, just in case anything goes wrong (file is missing, wrong url, etc.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since I'm running my app on the Bamboo stack I'm precompiling my assets and
Since yesterday suddenly my Eclipse does not work anymore. The error is Failed to
Since functions are first class objects, it should be possible to assign to the
Since yesterday I am looking for a way to save (mysql + php) dragged
Since recent runtimes in iOS, we are able to define properties that will generate
Since I added some scrollTop -animation, some parts of my callback get called twice:
Since I'm using Java 1.4.2, this means that I cannot use Java's implementation of
Since Java 5, we've had boxing/unboxing of primitive types so that int is wrapped
Since Sharepoint Foundation does't have integration services for InfoPath, I'm looking for a simple
Since I am new to using Unity 2.0, I need some pointer or suggestion

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.