在开发过程中,我必须使用几个不同的主机进行测试。在我使用navigateToURL 或mx:HTTPService 的任何地方都必须更改IP 地址是一件很痛苦的事情。
我想用IP设置一个var ...
public var hostIP:String = "192.168.1.100";
然后后来我没有做...
navigateToURL(new URLRequest('http://192.161.1.100/JudgesRegistration.html?email='+email+'&password='+password),'_self')
我想做类似...
navigateToURL(new URLRequest('http://'+hostIP+'/JudgesRegistration.html?email='+email+'&password='+password),'_self')
然后我只需要更改分配给 hostIP 的 IP,而不是整个项目。不幸的是,我不知道如何将 var 嵌入到 URL 字符串中。这甚至可能吗?
这是我的 HTTPService 的样子......
<mx:HTTPService
id="emailPasswordService"
method="POST"
url="http://192.168.1.100/chaos/emailPassword?output=xml"
makeObjectsBindable="true"
result="emailPasswordSuccess(event)"
fault="httpServiceFaultHandler(event)"
showBusyCursor="true"
resultFormat="e4x">
</mx:HTTPService>
谢谢,
约翰