PDA

View Full Version : change "5" to 5


Twister
04-05-2004, 04:57 PM
Ok I need help. Something is so stupid here and I don't get it.

I want to add some values together and it's not working. I'm getting

001532423 but i want 20

This is my code

for (x=1; x<32; x++) {
cubeScore = eval("_root.cube"+x).score;
finalScore += cubeScore;
}


:confused:

Ruben
04-05-2004, 05:03 PM
I think you used [ ACTIONSCRIPT ] instead of [ CODE ], edit the post and replace it and I'll take a look at your script...OK?

- Ruben

Twister
04-05-2004, 05:15 PM
oops. my bad.

but i found an answer....

old code:
for (x=1; x<32; x++) {
cubeScore = eval("_root.cube"+x).score;
finalScore += cubeScore;
}

new code
for (x=1; x<32; x++) {
cubeScore = eval("_root.cube"+x).score;
finalScore += Number(cubeScore);
}

Ruben
04-06-2004, 08:45 AM
Hehehe :p Don't have to worry about that anymore, I guess :o

See you around - Ruben