Error (#2148) Loading XML with Flex2 – Security Error

13 01 2007

I had this problem and thought you would all like to know….. I was trying to load a local xml doc and this solution worked for me.

Posted on January 11th, 2007 by polyGeek

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.


wscoop!

Advertisements

Actions

Information

9 responses

20 02 2007
Hal

The problem is that with

-use-network=false

you can no more get access to Internet resources such as normal Web pages. This is really annoying. Is there a way to avoid that?

27 02 2007
red01

Not to sure i will have to look into it… this was the solution for me as i just wanted to access the local machine….

26 04 2007
30 06 2007
Bill

The Eclipse -use-network=false trick worked for me… thanks!

3 06 2009
Mazen

I just encountered the same problem with my flex project and your post solved the day 😛 Thanks!!

28 08 2009
Sarah

I will totally repost this, word for word if you dont mind, I am lazy. Thanks so much for posting this and for the help. Here are other options as well: http://curtismorley.com/2007/09/01/flash-flex-tutorial-how-to-create-a-crossdomainxml-file/

15 11 2010
Gunjan

Worked for me 🙂

28 02 2013
Error (#2148) Local XML file loading error Issue | Simply Coder

[…] can read the post in this link. I am just adding 2 Flash Builder 4.6 editor image that how you can apply things at your […]

28 02 2013
Ehsanul Hoque Showrav

Hello Boss,

I wish i could found this article 3 days ago. At least i could save 3 day.

I have created an post

http://showrav017.wordpress.com/2013/02/27/error-2148-local-xml-file-loading-error-issue/ in reference of your post with image details.

Hope it will solve other people problem.

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




%d bloggers like this: