Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 10-08-2004, 02:01 PM
Member
Latest Blog:
None

 
Join Date: 08-05-04
Location: The Netherlands
Posts: 34
iTrader: 0 / 0%
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
__________________
Life is too short to be afraid.

top-download
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > 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

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


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


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 07:53 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.