开发者

Flex 4 - Technique to allow HTTPService testing locally and on development server

Right now I have my URLs hard-coded for HTTPService to work with my local machine's web server so that I don't need to copy files to htdocs after compiling. What's a good technique to easily transition HTTPService URLs from working on my testing setup to working with a normal web 开发者_如何学编程server setup?


Write a service to get the current environment your application is in, similar to how one tests if you're running in AIR or Flex.

In your HTTPService:

url="EnvironmentService.getURL1();"

In EnvironmentService:

public static function getUrl1():URL
{   
     return (LOCAL_ENVIRONMENT)? LOCAL_URL1 : LIVE_URL1;
}

If this doesn't work for you, post some more code and we'll work on a solution

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜