User Guide
870 Chapter 6: Components Dictionary
Example
The following example sets the params property for a web service component named wsc:
wsc.params = [param_txt.text];
WebServiceConnector.result
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
componentInstance.addEventListener("result", myListenerObject)
Description
Event; broadcast when a call to a web service completes successfully.
The parameter to the event handler is an object with the following fields:
• type: the string "result"
• target: a reference to the object that emitted the event (for example, a
WebServiceConnector component)
You can retrieve the actual result value using the
results property.
Example
The following example defines a function res for the result event and assigns the function to
the
addEventListener event handler:
var res = function (ev) {
trace(ev.target.results);
};
wsc.addEventListener("result", res);
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 wscListener:Object = new Object();
wscListener.result = function(evt:Object) {
trace(evt.target.results);
};
var wsConn:WebServiceConnector = new WebServiceConnector();
wsConn.addEventListener("result", wscListener);
wsConn.WSDLURL = "http://www.flash-mx.com/mm/tips/tips.cfc?wsdl";
wsConn.operation = "getTipByProduct";
wsConn.params = ["Flash"];
wsConn.trigger();