Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-24-2003, 06:18 PM   #1
adi_ady_ade
Registered User
 
Join Date: Apr 2003
Posts: 11
Default Copying a Recordset to a variable

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.

ActionScript Code:
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
adi_ady_ade is offline   Reply With Quote
Old 04-24-2003, 07:53 PM   #2
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Is that exactly how it looks in your movie, all in the same frame. If so, thats the problem, because the resultset isn't populated until the function is run, and you try to call it before it has loaded. Flash plays the entire frame from top to bottom, and the function never finishes before the trace line is called below the function.
freddycodes is offline   Reply With Quote
Old 04-25-2003, 09:43 PM   #3
adi_ady_ade
Registered User
 
Join Date: Apr 2003
Posts: 11
Default

I'd read something like that.

So what's the solution to it, I would of thought that having all the code in the same frame would be ok?

Should I put the call to the server in the first frame and all the manipulation in another frame? It doesn't seem quite right somehow

Can anyone point me towards good tutorials, all the ones I've found seem to do the same things?

Thanks for the reply.

Ade
adi_ady_ade is offline   Reply With Quote
Old 04-26-2003, 12:49 AM   #4
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Well just move to the second frame after the result function runs and try tracing it there. Like this

ActionScript Code:
//Frame 1: 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"]);          play();         }                 this.onStatus = function(error)         {                 trace("Error : " + error.description);         } } stop(); //Frame 2: trace("3: " + myResult.getItemAt(0)["DefaultURL"]); // This doesn't work stop();
freddycodes is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.