Security Sandbox Violation during run and debug after moving or copying a Flex project in Flex Builder

Ugh, this is one of those classic examples of getting sidetracked in your daily work because of some annoyances with Flex Builder. Today I copied an existing Flex Builder project in Eclipse to another directory (new renamed project). I then edited the project settings (renamed the project) before importing the new copied project into Eclipse. This worked great and Eclipse immediately imported the new project and recognized it as a Flex project.

The problem came up when I tried to debug my app. When I hit debug I got the dreaded *** Security Sandbox Violation *** (Adobe’s equivalent of the blue screen of death) once my app attempted to make an UrlLoader request for a sibling resource to the SWF. Now, at this point I was frustrated as this was an exact cloned copy of the project that still worked under the original project name in Eclipse.

Turns out, that during a true “Create new Flex Builder Project” setup in Eclipse, Flex Builder adds your project’s bin-release and bin-debug directories to the local Flash Players global security settings as a trusted resource. This is necessary so you can debug/run your Flex projects in eclipse without getting the Security Sandbox Violations when accessing local resources.

Now how to fix this?

Simply go here: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

and proceed to add your copied/new project’s bin-debug and bin-release dirs. Then next time you run, the security sandbox exceptions will go away, just as if you originally created the project in Flex Builder’s “wizards” of smart.

Advertisements

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s