我需要帮助来扩展正确的字符串??将我的 numericstepper 和/或文本显示字段格式化为货币格式。您可以从CS5 flash FLA HERE下载 FLA 。谢谢
/* start application */
import flash.geom.Matrix;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.text.TextField;
import flash.net.URLLoader;
import flash.globalization.CurrencyFormatter;
//comboBox, I populate values displayed to users
this.comptype.addItem ( { label: "clerical" } );
this.comptype.addItem ( { label: "concrete" } );
this.comptype.addItem ( { label: "demolition" } );
this.comptype.addItem ( { label: "electricians" } );
this.comptype.addItem ( { label: "excavation" } );
this.comptype.addItem ( { label: "HVAC/Plumbing" } );
this.comptype.addItem ( { label: "oil and gas" } );
this.comptype.addItem ( { label: "road/bridge construction" } );
this.comptype.addItem ( { label: "roofing" } );
this.comptype.addItem ( { label: "sewer construction" } );
this.comptype.addItem ( { label: "truck driving" } );
this.comptype.addItem ( { label: "warehousing" } );
this.comptype.addEventListener (Event.CHANGE, selectOrder);
function selectOrder (event:Event) : void
{
if (this.comptype.selectedItem.label == "clerical") this.orderTotal.text = ("3.00");
if (this.comptype.selectedItem.label == "concrete") this.orderTotal.text = ("8.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "demolition") this.orderTotal.text = ("10.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "electricians") this.orderTotal.text = ("5.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "excavation") this.orderTotal.text = ("8.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "HVAC/Plumbing") this.orderTotal.text = ("6.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "oil and gas") this.orderTotal.text = ("13.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "road/bridge construction") this.orderTotal.text = ("10.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "roofing") this.orderTotal.text = ("18.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "sewer construction") this.orderTotal.text = ("9.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "truck driving") this.orderTotal.text = ("13.00"); //make sure my values match the above values EXACTLY
if (this.comptype.selectedItem.label == "warehousing") this.orderTotal.text = ("7.00"); //make sure my values match the above values EXACTLY
}
this.outline.calcBtn.addEventListener (MouseEvent.CLICK, goCalc);
function goCalc (Event:MouseEvent) : void
{
this.outline.annualSavings.text = (this.staffrate.value-(14.15 + parseInt(this.orderTotal.text)))*this.payroll.value;
//this.outline.docCostMonth.text = (this.timesPerDay.value * 260) / 12 * this.docProcCost.value;
//this.outline.docCostYear.text = (this.outline.docCostMonth.text *12);
//this.outline.annualSavings.text = ((this.procAutoSaving.value * this.outline.docCostYear.text) / 100);
}
var cf:CurrencyFormatter = new CurrencyFormatter( "en_US" );
this.payroll.value = this.payrollOut;
cf.format( this.payrollOut.text ); //??