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.
The following is a Flash 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..."; }
The following table describes the code and its function:
Code |
Description |
---|---|
directoryService.search (firstName.text, lastName.text); |
Passes the contents of the firstName and lastName text boxes to server-side ActionScript. |
dataView.setDataProvider (null); |
Clears the dataView list box component. |
status.text = "waiting..."; |
Displays a message in the status text box while the record set is being retrieved from server-side ActionScript. |