adi_ady_ade
04-24-2003, 06:18 PM
I'm having trouble copying a RecordSet to a local variable so I can use it outside of the result function.
Here's the code I've tried, I've gone through lots of combinations but still can't get it right. I want to assign the Recordset returned to the local variable myResult and use it elsewhere in the ActionScript.
NetServices.setDefaultGatewayUrl... etc
var gw = NetServices... etc
var server = gw.getService( "cfcs.navigation", new Result() );
server.getMainNavigation();
var myResult;
function Result() {
this.onResult = function(result) {
if ( result.isFullyPopulated() ) {
trace("1: " + result.getItemAt(0)["DefaultURL"]); // This works
myResult = result;
trace("2: " + myResult.getItemAt(0)["DefaultURL"]); // This works
}
//trace("Data received from server : " + result);
//trace(result.getItemAt(0)["URL"]);
}
this.onStatus = function(error)
{
trace("Error : " + error.description);
}
}
trace("3: " + myResult.getItemAt(0)["DefaultURL"]); // This doesn't work
Can anyone point me in the right direction?
Thanks
Here's the code I've tried, I've gone through lots of combinations but still can't get it right. I want to assign the Recordset returned to the local variable myResult and use it elsewhere in the ActionScript.
NetServices.setDefaultGatewayUrl... etc
var gw = NetServices... etc
var server = gw.getService( "cfcs.navigation", new Result() );
server.getMainNavigation();
var myResult;
function Result() {
this.onResult = function(result) {
if ( result.isFullyPopulated() ) {
trace("1: " + result.getItemAt(0)["DefaultURL"]); // This works
myResult = result;
trace("2: " + myResult.getItemAt(0)["DefaultURL"]); // This works
}
//trace("Data received from server : " + result);
//trace(result.getItemAt(0)["URL"]);
}
this.onStatus = function(error)
{
trace("Error : " + error.description);
}
}
trace("3: " + myResult.getItemAt(0)["DefaultURL"]); // This doesn't work
Can anyone point me in the right direction?
Thanks