Error (#2148) Loading XML with Flex2
I was running through a simple tutorial for loading XML into Flex and displaying it in a DataGrid when I got the following error:
[RPC Fault faultString="Error #2148: SWF file file:///C:/Documents and Settings/.../My Documents/xmlParsing/bin/xmlParsing.swf cannot access local resource Blades.xml. Only local-with-filesystem and trusted local SWF files may access local resources." faultCode="InvokeFailed" faultDetail="null"]
If I go into the bin folder and launch the SWF directly then everything loads and works correctly. That right off is a tip that it’s probably a security issue. Sure enough. With a little research I found it.
- In the Navigator panel Right-click and select Properties
- In the lefNav select Flex Compiler
- In the Additional compiler arguments: field add the following argument: -use-network=false
So my arguments read: -locale en_US -use-network=false
It would seem that this setting has to be made for each project.
Stupid security settings. :-)
When I Googled this problem I only got three hits back. My guess is that this will be a common problem so it wouldn’t hurt for others to duplicate this solution to make it easier for others to find.
Aside: I had to create the Flex category to for this post. Nice to start things off with a fraking error.






