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.

This entry was posted in Flex. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

4 Comments

  1. Alex Unicorn
    Posted July 25, 2008 at 1:19 pm | Permalink

    Great find there pal!

  2. Posted September 16, 2008 at 3:05 pm | Permalink

    Thank you so much for this valuable tip!

  3. Clint
    Posted October 22, 2008 at 1:00 pm | Permalink

    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!

  4. Posted December 16, 2008 at 8:12 am | Permalink

    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!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

  • Pages

  • Categories

  • Archives