在mx:HTTPService标签中发现了serviceName一项,研究了一下发现是这样的用。在flex-config.mxl中配置service name,如下:
<service name="FormatSourceService"> <url>{context.root}/explorer/formatsource.jsp</url> </service>
在用的生活这样写:
<mx:HTTPService id="topics" serviceName="FormatSourceService" resultFormat="text" showBusyCursor="true"> <mx:request> <url>{selectedUrl}</url> </mx:request> </mx:HTTPService>
这样就不用写URL了,避免了硬编码。 
|