I am working on a claims-paid counter for one of my company's websites. I have a javascript that determines the value which the counter will start counting from. It then passes the variables to my flash file. The variables are successfully passed to the Flash file. However, when the Actionscript tries to increase the values of these variables so that the counter properly counts, the values get reset to 1000. If I hardcode the variable values in the Actionscript it works perfectly. Does anyone know why this happens? Thanks in advance.
Here's the Actionscript code:
Quote:
stop();
var cents = 100;
// Count the Cents
function CountUp() {
if (cents >= 99) {
cents = 10;
cents += 1;
addHundred();
}
else {
cents += 1;
}
}
// Set the CountUp Interval
setInterval(CountUp, 1);
// Add to Hundred
function addHundred() {
if (hundred > 1999) {
hundred= 1000;
hundred += 1;
addThousand();
}
else {
hundred += 1;
}
}
// Add a Thousand
function addThousand() {
if (thousand > 1999) {
thousand = 1000;
thousand += 1;
addMillion();
}
else {
thousand += 1;
}
}
// Add a million
function addMillion() {
if (million > 999) {
million = 500;
million += 1;
}
else {
million += 1;
}
}
|