Hello!
I could use some help with my calculator. It is suppossed to be exactly the same as the top one at www.ekonomikompassen.se. It’s a calculator for saving money.
I have done everything I can with it and I can’t figure out how to solve the problems!
Here is the .fla (76.5 kB) http://www.mediafire.com/file/z4wq4imario/sparverktyg.fla
Help would be much appreciated!
stop();
currentDate = new Date();
var months = new Array();
months[0] = "Januari";
months[1] = "Februari";
months[2] = "Mars";
months[3] = "April";
months[4] = "Maj";
months[5] = "Juni";
months[6] = "Juli";
months[7] = "Augusti";
months[8] = "September";
months[9] = "Oktober";
months[10] = "November";
months[11] = "December";
current_month = currentDate.getMonth();
end_year = currentDate.getFullYear();
end_day = currentDate.getDate();
onEnterFrame = function()
{
var_kvar = Number(_root.var_ss) - Number(_root.var_sk);
var_spar = Number(mySlider.ratio);
save_months = Math.ceil((var_ss - var_sk) / var_spar);
done_year.text = end_year;
if (var_kvar < 0)
{
var_kvar = "0";
} //end if
else
{
var_kvar = Number(_root.var_ss) - Number(_root.var_sk);
} //end else
end_month = current_month + save_months;
done_month.text = months[end_month];
ins_ss.onChanged = ins_sk.onChanged = mySlider.onChanged = function()
{
while (end_month > 11)
{
end_month = end_month -11;
end_year++;
}//end while
}//end while function
}//end function
done_year.text = end_year+end_month;
var var_ns:String = "Skriv namn här";
ins_ns.onSetFocus = function() {
if (ins_ns.text == "Skriv namn här") {
ins_ns.text = "";
ins_ns.textColor = 0xff2c00;
}else {
}
}
ins_ns.onKillFocus = function() {
if (ins_ns.text == "") {
ins_ns.text = "Skriv namn här";
ins_ns.textColor = 0xFF8E77;
}else {
}
}
ins_ss.onSetFocus = function() {
ins_ss.textColor = 0xff2c00;
}
ins_ss.onChanged = function() {
if (ins_ss.text == "") {
ins_ss.text = "0";
}else {
ins_ss.text = ins_ss.text = ins_ss.text;
}
}
ins_sk.onSetFocus = function() {
ins_sk.textColor = 0xff2c00;
}
ins_sk.onChanged = function() {
if (ins_sk.text == "") {
ins_sk.text = "0";
}else {
ins_sk.text = ins_sk.text = ins_sk.text;
}
}