![MACROMEDIA FLASH REMOTING MX Use Manual Download Page 58](http://html1.mh-extra.com/html/macromedia/flash-remoting-mx/flash-remoting-mx_use-manual_687566058.webp)
58
Chapter 3: Using the RemotingConnector component (Flash Professional only)
The ActionScript code for this example imports the RemotingConnector class and the
appropriate classes for the user interface components, and creates the CustomerInfoFormCon
class, which extends the Form class. The sections following the ActionScript code describe the
functions in this class.
import mx.data.components.RemotingConnector;
import mx.controls.DataGrid;
import mx.controls.gridclasses.DataGridColumn;
import mx.controls.ComboBox;
import mx.controls.TextArea;
import mx.screens.Form;
import mx.controls.TextInput;
import mx.controls.Label;
import mx.controls.Loader;
import mx.controls.Alert;
class CustomerInfoFormCon extends Form
{
function CustomerInfoFormCon() {
super();
initialized = false;
addEventListener( "reveal", onReveal );
}
// initializes the display
function onReveal():Void {
// initialize stuff
if( !initialized ) {
var col:DataGridColumn = new DataGridColumn( "ID" );
customers_grd.addColumn( col );
col = new DataGridColumn( "Active" );
col.width = 80;
customers_grd.addColumn( col );
col = new DataGridColumn( "Name" );
col.width = 250;
customers_grd.addColumn( col );
col = new DataGridColumn( "TotalSales" );
col.width = 80;
col.textAlign = "right";
customers_grd.addColumn( col );
// register a listener for change in selection in DataGrid
customers_grd.addEventListener( "change", onCustGrid_Change );
// setup remaining
mx.remoting.debug.NetDebug.initialize(); // initialize the NCD
totalRec_txt.setStyle( "textAlign", "right" );
totalSales_label.setStyle( "textAlign", "right" );
// Now we are ready to trigger categoryData_con to fetch all the
// categories in ComboBox - invoking trigger()
categoryData_con.addEventListener( "status", onCategoryDataFault );
categoryData_con.addEventListener( "result", onCategoryData );
customerData_con.addEventListener( "result", onCustomerData );
customerData_con.addEventListener( "status", onCustomerDataFault );