Contents > Developing ColdFusion MX Applications > Using Server-Side ActionScript > Using server-side ActionScript functions PreviousNext

Using server-side ActionScript functions

After you connect to the Flash Remoting service, you call functions that are defined in your server-side ActionScript files, and return results.

To call a function:

  1. Create an instance of the server-side ActionScript file using the getService function. This function instantiates the server-side ActionScript file as an object to be used on the client side. For example:
    albumService = gatewayConnection.getService("recordsettest", this) 
    

    Where recordsettest represents the name of the server-side ActionScript file, without the file extension .asr.

  2. Call a function defined in your server-side ActionScript object. Use dot notation to specify the object name followed by the function name; for example:
    albumService.getAlbum("The Color And The Shape", "1999");
    

    Where albumService is the instance of the server-side ActionScript file and getAlbum is a function that passes two arguments, "The Color and The Shape" and "1999".

    Note: Arguments must occur in the order defined in the function declaration.

  3. Handle the function results in ActionScript. See Using the function results in ActionScript.

Contents > Developing ColdFusion MX Applications > Using Server-Side ActionScript > Using server-side ActionScript functions PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.