Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : Need Some Serious Help With Calculations


tralfaz
4/27/2004 3:41:18 PM
[quoted text, click to view]

I put your code above into a file that allows input of commas and adds
output comma in the payment.
There may be a better formatting method but Flash seems so limited in that
respect.
The boxes are pre-filled in but you can change the values in the input
boxes.
In order not to modify your code I used the older method of variable names
for the text boxes instead of instance names.
http://members.cox.net/4my5cats/loanCalc.html
Source code.. Flash MX (not 2004)
http://members.cox.net/4my5cats/loanCalc.zip
hth
tralfaz

flashWannaBe
4/27/2004 8:38:17 PM
Hello All,

Posted below, I have a script put together to determine the loan monthly
payment amount...based on interest rate, no. of months, and loan amount.
Although the script works great...I need to set this calculator up to handle
commas. I really haven't found much info on this matter, so any help given
would be much appreciated. Thank you

on(release){
amt = Number(amount);
yrs = Number(monthCount);
rte = Number(interest)/1200;
pmt=(rte+(rte/(Math.pow((1+rte),(yrs))-1)))*amt;
pmt = pmt*100;pmt=Math.round(pmt);pmt=pmt/100;
payment = "$"+pmt;
}
AddThis Social Bookmark Button