I have a AS3 need to call 2 functions in a WS to get 2 return parameters.
But, it has
Compile Error:
1046: Type was not found or was not a compile-time constant: OperationEvent.
function onResult(e:OperationEvent):void {
function onFault(e:OperationEvent):void {
function onResult1(e:OperationEvent):void {
function onFault1(e:OperationEvent):void {
Code:
function GetStreamName(opName:String) {
var ws = new WebService("http://[publicip]/WebService/Service.asmx?wsdl");
var op:Operation = new Operation(ws);
op.addEventListener(OperationEvent.COMPLETE, onResult);
op.addEventListener(OperationEvent.FAILED, onFault);
op.CheckStreamName(opName);
}
function onResult(e:OperationEvent):void {
for (var prop in e.data){
trace (e.data[prop]);
}
streamName = String(e.data);
}
function onFault(e:OperationEvent):void {
trace (e.data);
prompt.text = "Fail";
}
function GetOpID(opName:String) {
var ws = new WebService("http://[publicip]/WebService/Service.asmx?wsdl");
var op:Operation = new Operation(ws);
op.addEventListener(OperationEvent.COMPLETE, onResult1);
op.addEventListener(OperationEvent.FAILED, onFault1);
op.CheckOpID(opName);
}
function onResult1(e:OperationEvent):void {
for (var prop in e.data){
trace (e.data[prop]);
}
OpID = String(int(e.data));
}
function onFault1(e:OperationEvent):void {
trace (e.data);
prompt.text = "Fail";
}