R – Air app swf assets in ApplicationStorageDirectory produce Sandbox Violation

airapache-flexSecurity

I have an Air application that lets users import jpg, png and swf files and use them as the source to an Image which they can drag around a Canvas.

The import function copies the selected file to an images directory inside ApplicationStorageDirectory.

When I click on an Image that has an swf as its source, I get a Security Sandbox Violation (eg. SecurityDomain 'app-storage:/Project1/images/menuBarBkgd.swf' tried to access incompatible context 'app:/Main.swf'). My mouseDown handler doesn't get called so I can't select it and allow it to be dragged.

Obviously this has something to do with the app: domain, but how do I get around this?

Best Answer

Why not use mouseChildren = false to block the mouse from accessing the image at all? A Sprite belonging to the AIR application could show the image, and handle incoming MouseEvents itself. Alternatively, you could read the BitmapData from your loaded image and use that to populate a new instance of Bitmap, native to the AIR application.

Related Topic