Hi,
I’m creating a small application and I’m having problems trying to divide the value from a textField.
What I have here are 4 inputFields and 2 textFields the problem is that when I try to divide the value from “totalYields” by 1 and display it on my ‘textField’ named “txtParts” it shows the same value on both textFields in other words it shows only the value from “totalYields” and ignores the operation.
This is the line I’m having problems with:
var totalParts:Number= Number(totalYields) / 1;
This is the complete code:
enterBtn.addEventListener(MouseEvent.CLICK, calculator,false,0,true);
function calculator(event:MouseEvent):void {
var partW:Number=Number(partW_txt.text);
var partL:Number=Number(partL_txt.text);
var sheetW:Number=Number(sheetW_txt.text);
var sheetL:Number=Number(sheetL_txt.text);
var partsX:Number=partW / sheetW;
var partsY:Number=partL / sheetL;
var totalYields:Number = partsX * partsY;
var totalParts:Number= Number(totalYields) / 1;
txtYields.text=String(totalYields);
txtParts.text=String(totalParts);
}
Can some be so kind and take a look at my code and let me know what the problem is? Why I can’t divide totalYields by 1 and show the result in my txtParts field?
var totalParts:Number= Number(totalYields) / 1;
txtParts.text=String(totalParts)