User Guide

Table Of Contents
834 Chapter 34: Using Server-Side ActionScript
Creating the Flash movie interface
The Flash movie interface example in this section consists of one frame with a variety of text
boxes and a submit button.
To create the Flash movie interface:
1.
In the Flash MX authoring environment, create a new Flash source file, and save it as
pDirectory.fla.
2.
Create two input text boxes. Name one text box variable lastName and the other firstName.
3.
Create a dynamic text box, and name its variable status.
4.
Insert a list box component, and name it dataView.
5.
Insert a push button component.
6.
Save your work.
The following figure shows what the pDirectory Flash movie might look like:
Submitting user data to the Flash Remoting service
To send data to server-side ActionScript, you must create a function that passes the data from the
Flash movie to server-side ActionScript. The
search function, applied at the frame level, collects
the user-entered data from the firstName and lastName text boxes and passes the data as function
arguments to the directoryService object, which is created when the Flash movie connects to the
Flash Remoting service. For more information, see “Checking for a Flash Remoting service
connection” on page 836.
The following is a Flash MX ActionScript example:
#include "NetServices.as"
function search()
{
// The search() method is defined in the server-side AS file
directoryService.search(firstName.text, lastName.text);
dataView.setDataProvider(null);
status.text = "waiting...";
}