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 开发者_Go百科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
Ok, I think I got it figured out. Here's the steps that I took to get it working on the remote server:
First, the service should be set up from Flash Builder as a data service on your local computer (local server running).
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.
Make sure to keep the folder structure the same on your remote server.
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.
Make sure your amf_config.ini file on the remote server is configured correctly.
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
精彩评论