views:

576

answers:

3

Hello,

I'm developing a Adobe AIR application using Flash Builder 4. This app needs to access a remote PHP service which is being hosted on a remote web server.

I am having troubles figuring out how to add a PHP data service which uses a remote service. I can add the PHP data service in Flash Builder as a service hosted on localhost, but given that this will not be feasible when the application is deployed, will not work.

Does anyone know how to connect a Flash Builder (Flex) project to a remote PHP data service?

Thanks, Chris

A: 

Chris - I'm having the exact same issue. My PHP data service is running on a remote web server and I need to connect Flash Builder 4 to it but it. Did you ever get this working?

Cameron
A: 

Ok, I think I got it figured out. Here's the steps that I took to get it working on the remote server:

  1. First, the service should be set up from Flash Builder as a data service on your local computer (local server running).

  2. After you have checked to make sure the service works from your local machine, upload your PHP service file to the remote server. Also, upload both gateway.php, amf_config.ini, and the ZendFramework folder.

  3. Make sure to keep the folder structure the same on your remote server.

  4. Add a constructor to your service.as file in Flash Builder with a line as follows: _serviceControl.endpoint = "http://www.remote.com/gateway.php"

    Where the URL is pointing to your remote gateway.php.

  5. Make sure your amf_config.ini file on the remote server is configured correctly.

Chrisc
A: 

Hi, is it possible to pass a variable to service.as for _serviceControl.endpoint eg:

_serviceControl.endpoint = MY_VARIABLE

where MY_VARIABLE is defined somewhere inside the AIR application or is user defined

Deskin