Search tutorials
Calculations
The actionscript goes on frame 2 of the actions layer .It calcuates the mortage repayment. I don't want to confuse matters with explaining how the mortgage calculations work. I'm not sure that I understand it myself!!
//calculate interest rate applicable to period
var periodicInterestRate = floInterest/intRepayments/100;
//length in periods
var TotPeriods = intTerm * intRepayments;
//periodic interest
var PeriodicInterest = intPrincipal * periodicInterestRate;
var base = 1;
var mbase = 1 + periodicInterestRate;
for (var i=0; i < TotPeriods; i++){
base = base * mbase;
}
//calculate Total Repayment
TotRepayment = floor(intPrincipal * periodicInterestRate / ( 1 - (1/base)));
Test the movie. Enter some figures and test the calculation.
| » Level Intermediate |
|
Added: 2002-08-07 Rating: 4 Votes: 3 |
| » Author |
| Applications Developer Marconi Australia |
| » Download |
| Download the files used in this tutorial. |
| Download (106 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!