Don't Use Delete for a CFC function Name if You Want to Call The Function From Flex
I was creating a new Flex 2.0 application using CFC's to do the create, read, update, and delete work in the database. While testing the delete CFC function from within Flex I got a syntax error when compiling if I tried to do ProgramDAO.delete( aProgramObj ).
delete is apparently a keyword in ActionScript (the word shows up blue in Flex Builder) and cannot be used as a function name even if the function is in a CFC.
I changed the function name in the CFC to deleteRecord and ProgramDAO.deleteRecord( aProgramObj ) works fine.
After checking the Programming ActionScript 3.0 documentation I found delete on the keywords list on page 75. When you do use the delete keyword as I tried to above you get a hard-to-understand error message. It took me a while to figure out the cause of the problem, so I'm posting this blog entry to hopefully help others avoid my mistake.
myRemoteObject.getOperation('nameOfCFCmethod').send(arg1,arg2,...);
myRemoteObject.Delete();
That should work.