all groups > macromedia flash flash remoting > august 2004 >
You're in the

macromedia flash flash remoting

group:

Remoting newbie question


Remoting newbie question tim99
8/29/2004 10:22:26 PM
macromedia flash flash remoting:
I've just gone through Flash MX Pro 2004 for Server Geeks, and thought remoting
looked easy.. until I tried to do it myself.

I'm using a Coldfusion MX CFC to get the data, and I know the result is coming
through properly, because the Net Debugger shows the data coming through.
However, my SWF file (from MX 2004 Pro) shows my variable as "undefined".

Any help would be much appreciated... I'm only trying to get one Dynamic text
area to populate as a test; other variables will go from there.

Actionscript is below:
---------------------------------------------
#include "NetServices.as"
#include "NetDebug.as"

var frGatewayURL = "http://localhost/flashservices/gateway";
var frServiceName = "tlwebbFlash.random_testimonial";

var rsTestimonial;

this.onLoad = function() {

NetServices.setDefaultGatewayUrl(frGatewayURL);
var frConnection = NetServices.createGatewayConnection();
var frService = frConnection.getService(frServiceName, this);

frService.getTestimonial();
}

// Fires upon successful receipt of data from server
function getTestimonial_Result(result) {
// Assign items in recordset to the DataSet component
rsTestimonial = result;
// Set contents of visual controls
txtFirstName.text = rsTestimonial.firstname;

}

function getTestimonial_Status(error) {
trace("Remoting Error");
trace(error.type);
trace(error.description);
trace("---");
trace("Data received from server : " + result);

}

---------------------------------
Re: Remoting newbie question jameslyon
8/30/2004 5:16:48 PM
Re: Remoting newbie question tim99
8/30/2004 5:53:49 PM
Thanks for the quick reply... unfortunately I did that at home over the
weekend, now I'm trying it at work and it can't find the remoting gateway...
maybe because I'm on XP. I'll try it again tonight at home and post the error.
In the meantime, anyone know of problems with remoting on XP Pro?
Re: Remoting newbie question tim99
8/30/2004 6:04:30 PM
Never mind the XP issue, I fixed remoting at work from a technote... anyway,
here is the debugger's output:

Result (object #2)
.....length: (undefined)
.....mRecordsAvailable: 1
.....serverinfo: (undefined)
.....uniqueID: 1
.....items (object #3)
..........[0] (object #4)
...............ID: 3
...............__ID__: 0
...............firstname: "Miriam"
...............imgafter: "mirs_pr.jpg"
...............lastname: "Strassberg"
...............poundslost: "30"
.....mTitles (object #5)
..........[0]: "ID"
..........[1]: "firstname"
..........[2]: "lastname"
..........[3]: "imgafter"
..........[4]: "poundslost"
.....views (object #6)
..........No properties

-----------
All of that data is what I need to be displaying. Not sure why I can't display
it.
Re: Remoting newbie question jameslyon
8/30/2004 9:21:17 PM
Re: Remoting newbie question tim99
8/30/2004 11:29:35 PM
Re: Remoting newbie question jameslyon
8/31/2004 1:34:19 AM
Re: Remoting newbie question tim99
8/31/2004 3:21:44 PM
Ah, thanks... I tried that now, and it just says:
Re: Remoting newbie question tim99
9/1/2004 11:17:58 PM
AddThis Social Bookmark Button