Alright, I've been trying to figure out what I'm doing wrong here. As
far as I can guess, the method I'm defining within a function I use
for flash remoting will not call a method that I have previously
defined. I'm guessing this is while all the examples out there use a
template and store all their functions as variables in order to avoid
additional function calls. Simply put the following code executes
everything without error, but the responseHandler.onResult method that
is called by the myService object after results are recieved from the
insertNewCustomer method does not call the GetCustomerFilesScript
function defined earlier in the script. GetCustomerFilesScript can be
as simple as just one alert statement and it will not execute. You
can define an alert statement right before calling the
GetCustomerFilesScript function and that WILL execute.
Any ideas?
function insertCustomer() {
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection("http://
#cgi.HTTP_HOST#/flashservices/gateway/");
var myService:mx.remoting.NetServiceProxy;
var responseHandler = {};
responseHandler.onResult = function( results: Object ):Void {
var newitemindex = 0;
var newitemkey = 0;
_root.currentCustomers.dataProvider = results.items;
for (var i=0; i lt _root.currentCustomers.length; i++) {
if (_root.currentCustomers.dataProvider[i]
['CUSTOMER_KEY'] gt newitemkey)
{
newitemkey = _root.currentCustomers.dataProvider[i]
['CUSTOMER_KEY'];
newitemindex = i;
}
}
_root.currentCustomers.selectedIndex = newitemindex;
//This is the function that is not being called
GetCustomerFilesScript();
}
responseHandler.onStatus = function( stat: Object ):Void {
alert("Error while calling cfc:" + stat.description);
}
myService = connection.getService
("#APPLICATION.loc#.CFC.DataEntry", responseHandler );
myService.insertNewCustomer('#APPLICATION.dsn#','Enter ID',
0,0,'','Enter Customer Name',0,'','','','','');
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Houston ColdFusion
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en
-~----------~----~----~----~------~----~------~--~---