Kier,
It may be that the function is not seeing where the
GetCustomerFilesScript is located. You might want to try and designate
it at the root level. I'm assuming that you are doing Flash Remoting
with Coldfusion Flash Forms. Sometimes when it can't locate a function
it won't throw an error. It just acts as if it doesn't exist.
If you attempt to force an error in the calling of the cfc does
the onStatus throw the alert?
If this is a new app I'd recommend that you bite the bullet and
learn Flex. The data handling is much better and quite a bit more
powerful using the ArrayCollection class to store query results.
Allows you to do all those neat things, i.e. sorting, filtering, etc
in the flex component rather than have to make repeated cfc calls.
Mark
On Jan 14, 11:24 am, [email protected] wrote:
> 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
-~----------~----~----~----~------~----~------~--~---