Heeyz
I've been trying to fix this problem for a while but havent succeeded so far
Would appreciate some help
I've got a flash game which sends its score allong with a checksum to a php script.
For the checksum you multiply the score with 63478256 and then take the first number and multiply it with 1 then substract 1 then take the second number and multiply it with 2 then substract 1 then take the third number and multiply it with 3 and substract 1.. and so on.
In php the code looks like this:
PHP Code:
$score = $holder['score'];
$score = "$score";
$scorepre = $score*63478256;
$scorepre = "$scorepre";
for($c=0;$c<strlen($scorepre);$c++) {
@$realscorecheck+=$scorepre{$c}*($c+1);
@$realscorecheck-="1";
}
echo $realscorecheck . "<br>";
for a score of 200 this would output 177
In actionscript i think it should look like this: (not fully working:S)
PHP Code:
_root.scoreprecheck = _root.score*63478256;
_root.scorecheck = 0;
for (c=0; c<length(_root.scoreprecheck); c++) {
_root.scorecheck+=_root.scoreprecheck.substr(c,1)*(c+1);
_root.scorecheck-= "1";
}
trace(_root.scorecheck);
}
When running my game in swishmax it outputs 177.
When running my game in a browser it outputs -11
Why are the results in the browser and in swishmax different.
And what am i doing wrong?
Hope sombody knows
Greetz
Thierry