Skip to main content
Known Participant
February 11, 2011
Question

Flex Photoshop Panel won't read local XML file

  • February 11, 2011
  • 1 reply
  • 1703 views

I've created a panel for Photoshop which reads an XML file to populate some controls. When run from Flash Builder 4 through the web browser it works just fine, but when run from within Photoshop the XML file is not being read. Uploading the XML file to a web site and referencing it via URL in the panel works sucessfully in both the web browser and from within Photoshop, suggesting some type of security issue.

The Panel Developer's Guide FAQ talks about giving the Adobe Flash Player trust permissions by creating .cfg files that reference the folder the panel is running from.

I have created these .cfg files and placed them in both:

/Library/Application Support/Macromedia/FlashPlayerTrust

and also in:

USER/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust

but the problem remains.

Environment:

Mac OSX 10.6

Photoshop CS5

Flex Builder 4

Flex SDK 3.5

Any help/suggestions appreciated.

This topic has been closed for replies.

1 reply

Known Participant
February 11, 2011

I should probably mention that I'm using <mx:HTTPService url="filename.xml"...etc/> for reading in the XML file and not FileReference.load() or anything like that...

Known Participant
February 12, 2011

I tried using the -use-network=false compiler directive in the properties of my project and this failed as well.

One suggestion I had elsewhere was to read the local XML file with Javascript and pass this back to my panel cia CSXS... I'm about to resort to exploring this if there is no way to just read it from within my panel code directly.

I get the whole sandbox thing but it would seem the mechanisms in place to allow this to work should...work.

Participant
October 9, 2012

I had the same issue but I got it to work. I figure I update this thread in case somebody is trying to do the same. I didn't need to use javascript in order to load the XML. Just create the XML object:

<mx:XML id="myXML" source="data.xml" format="e4x"/>

Remeber to use e4x. The in the AS3 code I bound it to a var:

private var _XML               :XML;

_XML = myXML;

then....

private var _itemsXMLList      :XMLList;

_itemsXMLList = _XML.node;

Don't forget to add "-use-network=false" to the properties > Flex compiler > additional compiler arguments.

Hope that helps.