ActionScript 2.0 Components Language Reference |
|
|
|
| WebServiceConnector component > WebServiceConnector.trigger() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
componentInstance.trigger();
Method; initiates a call to a web service. Each web service defines exactly what this involves. If the operation is successful, the results of the operation appear in the results property for the web service.
The trigger() method performs the following steps:
params property, the method executes all the bindings to ensure that up-to-date data is available. This also causes data validation to occur.suppressInvalidCalls is set to true, the operation is discontinued.send event is emitted.This example returns data from a remote web service and traces a tip. Drag a WebServiceConnector component into your library, and enter the following code on Frame 1 of the timeline:
import mx.data.components.WebServiceConnector;
var res:Function = function (evt:Object) {
trace(evt.target.results);
};
var wsConn:WebServiceConnector = new WebServiceConnector();
wsConn.addEventListener("result", res);
wsConn.WSDLURL = "http://www.flash-mx.com/mm/tips/tips.cfc?wsdl";
wsConn.operation = "getTipByProduct";
wsConn.params = ["Flash"];
wsConn.suppressInvalidCalls = true;
wsConn.trigger();
|
|
|
|