User Guide

Table Of Contents
About server-side ActionScript 825
For example, the following server-side ActionScript code builds on the client-side code shown
previously:
// Filename: stockquotes.asr
// Here is the getQuotes method invoked in the client-side ActionScript.
// It accepts a single stock quote symbol argument.
function getQuotes(symbol)
{
// Query some provider for the specified stock quote and return the
// results. In this case, the getQuotesFromProvider method is
// defined elsewhere in this ActionScript code.
data = getQuotesFromProvider(symbol);
// Return the data to the client.
// Note: this example does not include any of the error checking
// logic you would normally use prior to returning the data.
return data;
}
The getQuotes function conducts the stock quote request and returns the results of the request
to the client as a RecordSet object.
Software requirements
To use server-side ActionScript files, you must have the following software installed:
Macromedia Flash MX
Macromedia ColdFusion MX
Flash Remoting Components
For more information about these products, go to www.macromedia.com.
Location of server-side ActionScript files
You can place ActionScript files (
*.asr) on the server anywhere below the web servers root
directory. To specify subdirectories of the web root or a virtual directory, use package dot notation
(use dots instead of slashes in a fully qualified directory name). For example, in the following
assignment code, the stockquotes.asr file is located in the mydir/stock/ directory:
stockService = gatewayConnnection.getService("mydir.stock.stockquotes", this);
You can also point to virtual mappings, such as cfsuite.asr.stock.stockquotes where
cfsuite is a virtual mapping and asr.stock is subdirectories of that mapping.
Benefits
Server-side ActionScript lets your ActionScript engineers use their knowledge of ActionScript to
write code for the back end of their Flash applications, which can mean more meaningful levels of
interactivity for your users. Your Flash applications can share a library of server-side ActionScript
functions, which means you can define functions that are specifically tailored to your own
business.