![]() ![]() ![]() |
||
|
Creating ActionScript that executes on the server helps leverage your knowledge of ActionScript. It also provides direct access to ColdFusion MX query and HTTP features. The CF.query
and CF.http
ActionScript functions let you perform ColdFusion MX HTTP and query operations.
Note: On the server side, ActionScript files use the extension .asr.
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.
|
||
![]() ![]() ![]() |