Skip to main content
Participant
August 26, 2009
Question

Web access library

  • August 26, 2009
  • 2 replies
  • 1330 views

I am in the process of scoping out a project for a client and I am trying to determine whether using the web access library, we can directly connect to a mysql database on a server and perform queries on the server to retrieve data from the server. I cannot find any examples of this. Is this possible? If so, can you point me to an example? Is the "HTTPConnectionObject" or the "Socket Object" what we would use?

This topic has been closed for replies.

2 replies

Participant
September 18, 2009

That's a nice tip..I would gladly use that too.

dfranzen_camera_raw
Adobe Employee
Adobe Employee
August 28, 2009

You can find an example using the Socket class in the BasicEmailer.jsx that's part of the Bridge CS4 SDK.

Another approach you may may want to look at seriously is to do all your networking stuff in ActionScript instead of in ExtendScript. You can use Flex Builder to develop a SWF that plays inside an a ScriptUI window or tabbed panel in Bridge. The SWF and your and your Bridge script can communicate via the External Interface. See the FlashDemo.jsx in the SDK for an example of how to get your ActionScript and ExtendScript talking to each other. You'll find a lot of examples on on the web about how to connect to HTTP services using Flex.

-David

KellyintxAuthor
Participant
August 28, 2009

Thanks for the reply, David.

I see the communication with the server via sockets in the BasicEmailer.jsx example but I'm looking for an example of how to connect to a database and retrieve information from the database for use in our script.

The solution we have decided to implement is to create a php script to pull the data into an XML file stored on the server and then use ExtendScript to retrieve the file from the server and process the data in the XML file to create Photoshop files.

I have used Flex in the past however there are 2 reasons why it's not appropriate for this project. First, no UI is required (our script is going to be fully automated) and second, the cost to purchase a new tool when we have Creative Suite available to us.

Thanks again.