
Using the Flash Remoting ActionScript API in the CustomerInfoExampleAPI application
49
col = new DataGridColumn( "TotalSales" );
col.width = 80;
col.textAlign = "right";
customers_grd.addColumn( col );
customers_grd.addEventListener( "change", onCustGrid_Change );
// setup remaining
totalRec_txt.setStyle( "textAlign", "right" ); //set the textField to
Left Align
totalSales_label.setStyle( "textAlign", "right" );
initialized = true;
}
}
// updateDetails will update the details TextArea, textInput and the
// Loader present on the screen changes will be updated when the selection
// in DataGrid changes
function updateDetails():Void {
var curItem:Object = customers_grd.selectedItem;
custInfo_txt.text = curItem.Details;
totalSales_label.text = curItem.TotalSales;
custLogo_ldr.load( curItem.Logo );
}
// gets the customer data for the current category selected
function refreshCustomerData():Void {
var pc:PendingCall = custService.getCustomers( custCat_cmbo.selectedItem.
data );
pc.responder = new RelayResponder( this, "onCustomerData",
"onCustomerDataFault" );
}
// updates the detail section when a new item is selected in the grid
function onCustGrid_Change( eventObj: Object ):Void {
mx.remoting.debug.NetDebug.trace({ level:"Debug",
message:"onCustGrid_Change" });
eventObj.target._parent.updateDetails();
}
// updates the grid with the new customers based on the category selected
function onCustCat_Change( eventObj: Object ):Void {
eventObj.target._parent.refreshCustomerData();
}
// handles the results from the getCategories() call
function onCategoryData( re:ResultEvent ):Void {
mx.remoting.debug.NetDebug.trace({level:"Debug", message:"onCategoryData"
});
// use data glue to remap the fields so that label = name field and data =
id field
DataGlue.bindFormatStrings( custCat_cmbo, re.result, "#Name#", "#ID#" );
custCat_cmbo.addEventListener( "change", onCustCat_Change );
refreshCustomerData();
}
Содержание FLASH REMOTING MX
Страница 1: ...Using Flash Remoting for Flash MX 2004 ActionScript 2 0...
Страница 8: ...8 Contents...
Страница 62: ...62 Chapter 3 Using the RemotingConnector component Flash Professional only...
Страница 142: ...142 Chapter 7 Using Flash Remoting for Java...