开发者

Using a remote PHP service with Flex (Flash Builder) AIR Application?

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:

  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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜