
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
410
|
Chapter 11: Flash Remoting
The remoteMethod parameter is a dot-delimited path to the file, in which the method
name is the last part of the string. Depending on the server configuration, the full
path from the server root will have to be specified. The remote method format is:
topfolder.subfolder.file_no_extension.method
In Example 11-1, remoteMethod is “services.TestService.dataEcho”. This means that
the remote method named dataEcho( ) exists in a file named TestService.cfc (for
ColdFusion) within a directory named services, which resides in the server root direc-
tory.
The
resultObject parameter is the object that receives the results from the remote
call. If the object has an onResult( ) method defined, it receives a single argument
containing results returned by the remote method. If the remote method fails for any
reason, the onStatus( ) method, if any, is called instead of onResult( ). The onStatus( )
method receives a single argument, an information object, which has a minimum of
three properties:
level, code, and description. These properties describe the nature
of the error as well as a description of the problem. If the remote procedure does not
return any results or you do not need to receive the results, you can pass
null as
resultObject.
In Example 11-1,
resultObject was