0

i have been working on a Photoshop UI project and also working with Flash Builder for about 3 weeks and i can't find a solution to a communication problem. Here are some details about the issue; if you are interested in helping me, thanks.

  • The main frame of the UI is Extendscript

  • I have an as3 swf which needs to load a local JPG file dynamicly, I assume this is a "Access Local Files Only" situation for Flash.

  • The same SWF needs to communicate with Extendscript, so i load it into a FLEX app dynamicly via SWFLoader and it passes some variables to, and triggers some functions in FLEX via a "myFlexParent" object.

  • Flex is the bridge between Flash and Extendscript so it passes the variables and functions to Extendscript JSX code via Externalinterface.call or CSXSInterface.instance.evalScript().

This is where i'm STUCK. I guess ExternalInterface calls or CSXSInterface.instance.evalScript() are threated as a network operation and they don't work if i set the compile option "-use-network=false" in flex. Bu otherwise the local JPG file cannot be loaded.

Adding locations in the Settings Manager wont work for me because i'm going to turn the UI into an Extension and it should be easy to install.

I guess i'm trying to find a way to establish 2 way communication between FLEX and ExtendScript, that would be interpreted by flash player as a LOCAL communication, which actually is.

I'll appreciate any bit of information. Thanks.

1 Answer 1

0

ExternalInterface is going to be considered a network call and setting the -use-network=false will break those calls down. This is due to the security sandbox. If it was allowed then the flash app could be used with some simple AJAX to turn a non-network app into a network app very easily.

Adobe doc's say:

This communication relies on the domain-based security restrictions that the allowScriptAccess and allowNetworking properties define. You set the values of the allowScriptAccess and allowNetworking properties in the SWF file’s wrapper.

Reference link:

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6167e-7fff.html#WS2db454920e96a9e51e63e3d11c0bf6167e-7ff5

Look into changing your app into an AIR app as you will be able to do both network and local file operations (different security model since the user installs the application).

1
  • thank you for the answer Nate, i have been trying to get some info about air, this app should work inside Photoshop as a panel, so i don't know if it can be done with air. Sending the bitmap image data from extendscript to flash and creating the bitmap there, seems to be the ultimate solution to me now, which i don't know how to do. Best.
    – eren
    Jun 10, 2012 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.