Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

Looping errors

$
0
0

Hello, I need some help with my code as it has 5 errors in which I do not know how to fix. My assignment has to look like this:CompoundInvesting.jpg

Here are the errors:

Screenshot_1.png

Here is the code:

 

//This line makes the button, btnPrint wait for a mouse click  //ERROR 5000 IS APPARENTLY HERE

//When the button is clicked, the countNumbers function is called

btnPrint.addEventListener(MouseEvent.CLICK, countNumbers);

 

function countNumbers(e:MouseEvent):void

{

var Year:uint = 1;

var Amount:Number;

var Interest: Number;

var Total: Number;

var NYear: uint;

 

Amount = Number(txtinInvest.text);

Interest = Number(txtinRate.text);

NYear = uint(txtinYears.text);

 

while (Year <= NYear)

{

lblYear.text += String(Year) + "\r";

Year++;

}

 

do

{

lblAmount.text += Amount.toFixed(2) + "\r";

lblAmount.text += String(Amount) + "\r";

Interest /= 100 *= Amount += Amount;

}

while (1 < Amount)

 

while (0 < Interest)

{

lblInterest.text += Interest.toFixed(2) + "\r";

lblInterest.text += String(Interest) + "\r";

(Interest /= 100 *= Amount) += Amount *= (Interest /= 100); //ERROR 1105 IS HERE

}

while (0 < Total)

{

lblTotal.text += Total.toFixed(2); + "\r";

lblTotal.text += String(Total) + "\r";

Amount + Interest;

}

 

}

 

I got the Year column to work but not the others. Kindly edit my code to make it look like the program.


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>