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);
}
---------------------------------