In my application I am accessing a XML file which is in the same location as the fla, yet I have to add my folder location to the Flash Global security settings in order to avoid that infamous Security violation that is thrown. Thats fine in my development environment, however when deployed on a customer's machine they have the same issue. Is there a way programmatically to to trust the xml file and avoid the security violation? NOTE the customer is accessing the swf in 2 ways through a .NET loading mechanism and 2. opening the file location in a web browser (NOT in a we page but opening the swf directly - YES I know this is not recommended - but nevertheless is the customer's preference)
There's a couple of things you can do.
1) You can make your SWF an AIR app, which doesn't have the same security requirements as simple SWFs.
2) If you don't need to access the XML outside of the SWf, consider using the SharedObject
class - you don't need to change anything in your code; just save the XML object inside the SharedObject. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html
3) If the XML isn't changing, then you can directly embed it in the SWF ( http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf60546-7ff2.html and http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf60546-7ffb.html ). This will avoid everything and enable you to access the XML directly without needing to load it.