SecurityError Loading Local Files AND Accessing Internet Resources

When you create a new Flex or ActionScript project in Flex Builder you are immediately able to access local files (config XML, etc) and internet resources at the same time.

But if you decide to import a project, or move or rename your current project suddenly you’re prompted with the dreaded Security Sandbox Violation: Security Error: Error #2148.

I’ve had this happen in the past, but often I was just loading a local XML file and I would just add -use-network=false as a compiler argument and all would be happy.

This however will then prevent you from accessing resources from the internet presenting you with yet another Security Sandbox Violation: Security Error: Error #2028. Not a great solution.

Lo and behold, Jesse Warden has the fix.

But to quickly recap, when Flex Builder creates a new project, it adds a new line item to two files giving permission to the new project’s bin directory to access both local and internet resources.

Here is the location of the two files (flexbuilder.cfg and flexbuilder.fbr):

PC:
C:\Documents and Settings\[username]\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust

Mac:
[user]:Library:Preferences:Macromedia:Flash Player:#Security:FlashPlayerTrust

Now just add a new line item to each file (copying the one above if necessary) and change the paths to match your project’s bin or bin-debug directory.

Done.

About the author

Mark

View all posts

5 Comments

  • Thank you! I have had this problem so many times, its nice to finally understand what is going on behind the scenes. As a side note, I was able to fix the problem without editing any files by restarting FlexBuilder and my Browser. (I checked the files, and the proper entries had been added automatically.) That also explains why I ran into the problem so sporadically- it was fixing itself if I restarted the applications!

  • Ah finaly i got it working =)
    But i can’t get it working without edeting. Seems like it is not fixing it itself. Maybe i need to update…

    I’ll drop by time by time to see how this will envolve.

    Anyway, thank you!

  • Also note that you may need to restart your browser (at least if it is Firefox 3.6 under Ubuntu 9.10) for the new security settings to be loaded!

Leave a Reply

Your email address will not be published. Required fields are marked *