Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 10-08-2004, 03:01 PM   #1 (permalink)
Inactive
 
Join Date: 08-05-04
Location: The Netherlands
Posts: 55
iTrader: 0 / 0%
Latest Blog:
None

lajkonik86 is liked by many
Got an actionscript problem

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=0c<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
lajkonik86 is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
posting using actionscript... wulf2001 Coding Forum 0 01-15-2007 10:17 PM
Flash actionscript programming Ricoool Web Design Lobby 0 07-07-2005 05:17 AM
Php to XML to Flash ActionScript - please help a_whale Coding Forum 1 06-11-2005 02:20 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:00 AM.
© Copyright 2008 V7 Inc