Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
Creating a mortgage calculator in Flash MX
Author: Sas Jacobs
| Website: http://www.sasjacobs.com |
Functions
We'll need the following functions:
- CalculateRepayment - plays the calculate frame. Later, we'll add validation
to this function.
- setRepaymentTerm - sets the value of the intRepayments variable
- StartOver - plays the first frame of the movie
- floor - used to round the repayment to two decimal places
Add the code shown below to the first frame of the functions layer.
function CalculateRepayment(component) {
gotoAndPlay("calculate");
}
function setRepaymentTerm(component) {
intRepayments = component.getSelectedItem().data;
}
function StartOver() {
gotoAndPlay("start");
}
function floor(number) {
return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
}
Test the movie. If you click the Calculate button, the second frame should
display. Then you can click the New Calculation button to go back to the
first frame.
| » Level Intermediate |
|
|
Added: : 2002-08-07
Rating: 1463.47 Votes: 45
Hits: 1255
|
| » Author |
|
Applications Developer
Marconi Australia
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (106 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|