Can I dynamically instantiate a webservice or httpservice in actionscript? : adobe flex action script
Answer Posted / Ravindra Singh Verma
Yes, you can dynamically instantiate WebService and HTTPService components in ActionScript. Here's an example:
```actionscript
import mx.rpc.http.HTTPService;
var myHttpService:HTTPService = new HTTPService();
myHttpService.url = 'your_webservice_url';
myHttpService.showBusyCursor = true;
myHttpService.resultFormat = mx.rpc.AsyncToken.FORMAT_OBJECT;
myHttpService.addEventListener(ResultEvent.RESULT, onResult);
myHttpService.send();
function onResult(event:ResultEvent):void {
// Handle the result here
}
```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers