Shannon, Valid but Bad example. Try this.
employeeRO.getOperation(methodName).send (deptComboBox.selectedItem.data); --- In flexcoders@yahoogroups.com, "Shannon Jackson" <[EMAIL PROTECTED]> wrote: > > That is not the line that is failing; that is the line that binds the event > listener to the operation. we're trying to execute the method dynamically > (line six of second example)-- have you done that? > > Thnx, -Shannon > > employeeRO.getOperation(methodName)].addEventListener > ("result",getListResultHandler); > > Michael Ramirez > > --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com> ups.com, > "Shannon Jackson" <flex@> wrote: > > > > In the Flex 2 Developers Guide, it shows an example of how to > script a > > remote object as follows: > > > > employeeRO = new RemoteObject(); > > employeeRO.destination = "SalaryManager"; > > employeeRO.getList.addEventListener ("result",getListResultHandler); > > employeeRO.addEventListener("fault", faultHandler); > > employeeRO.getList(deptComboBox.selectedItem.data); > > > > Does anyone know how to do the same thing but implement it so the > method > > name is variable? Like this: > > > > var methodName:String = "getList"; > > employeeRO = new RemoteObject(); > > employeeRO.destination = "SalaryManager"; > > employeeRO[methodName].addEventListener > > employeeRO.addEventListener("fault", faultHandler); > > employeeRO[methodName].(deptComboBox.selectedItem.data); > > > > It fails on the sixth line here (the second variable call) with > this error: > > > > Error #1006: value is not a function. > > > > It appears the first attempt correctly creates the > > mx.rpc.remoting::Operation object, but when you attempt to actually > run the > > service method it fails. Any ideas? > > >