Sending JPG data From PHOTOSHOP to FLASH

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Erengoksel

Sending JPG data From PHOTOSHOP to FLASH

Post by Erengoksel »

Hey everyone,

i have a flex swf running in Photoshop Extendscript.

This flex contains a Flash swf.

These 3 should communicate, and it is done via ExternalInterface.call() which needs both swfs to be compiled in the network mode.

But the Flash swf needs to read a local JPG file because the whole app is actually local. So a security issue comes up and the Flash swf can't read the jpg.

I assume i can find a workaround if i can make Extendscript read the JPG file binary data and pass it to flash and construct the bitmap inside flash without loading it from the local disk. I don't know how it can be done or even if it is possible!!

Any ideas?

Thanks.

== Some Notes ==
i've found this workaround for loading the local bitmap into swf and it works perfectly on Windows but no chance on Mac:
http://www.inklink.co.at/blog/?p=14

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

csuebele

Sending JPG data From PHOTOSHOP to FLASH

Post by csuebele »

Does the swf and script have to be compiled in network mode? It seems if all the apps are local, you should not have sandbox issues. You do need to set up a trust file in the proper location for the OS you're using - One of the reasons using flash with extendscript is a PIA, as it makes loading everything in the proper places a hassle.
Erengoksel

Sending JPG data From PHOTOSHOP to FLASH

Post by Erengoksel »

csuebele wrote:Does the swf and script have to be compiled in network mode? It seems if all the apps are local, you should not have sandbox issues. You do need to set up a trust file in the proper location for the OS you're using - One of the reasons using flash with extendscript is a PIA, as it makes loading everything in the proper places a hassle.

Hey, thanks for answering.

if both files are compiled in Network Mode, ExternalInterface.call works, but the child swf doesn't load the local file.
if both files are compiled in Local mode, ExternalInterface.call doesn't work.
it also doesn't work if two swf files are in different modes.

i figured out that it is not a OS issue, i use CS5 on my mac, i think it is a CS version issue, works fine with CS4 Photoshop, not with CS5.

i managed to send the jpeg data from extend script to flash by the way, by using a Base64 library, but it is very very slow. Takes about 4-5 minutes to send a 780x1100 image.

I also could not find any settings or options about network/local mode inside Extendscript. the whole project works fine in its own flex folder, but not outside of it.

I don't want to solve it via a trust file, it would be kind of disturbing for the end user, as far as i know there is no way of making it automatically.

So i'm stuck.

Thanks.
csuebele

Sending JPG data From PHOTOSHOP to FLASH

Post by csuebele »

Yea, it sounds like you're stuck. I've only used the swf's using ActionScript 3 with uses a different interface from Flex, but you have to have a trust file, which is very annoying.