Jump to content

hahaitwork

Members
  • Posts

    6
  • Joined

  • Last visited

hahaitwork's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Then what is your idea ? I have posted my code and checked it lots of times but im pretty new to this and I dunno what to do
  2. is this forum pretty dead or is it one person going thru every topic and rest is asking for help..?
  3. Is it this two u are talking about:$name .= 'name'.$i.'='.urlencode($row['name']).'&';$scores .= 'score'.$i.'='.urlencode($row['score']).'&';?? http://www.loff-production.com/test/ST_test.html Thats the game etc, I know its some bugs etc, but yeah.. just showing my idea.
  4. yeah, my bad.. had to post it really quick!My problem is that my high score wont be loaded, and it wont sumbit my name and score to the database.Will tell more if u need! can post SWF file if u want or so?
  5. hello,I'm in need of getting my high score to work in my game.It won't load the high scores and it wont post the scores :SThis code is from: get_score2.php<?php$db=mysql_connect("loff-production.com.mysql", "loff_production", "Mypassword");mysql_select_db("high_scores", $db);$scores = '';$name = '';$query = "select * from high_scores order by score DESC LIMIT 0,10";$result=mysql_query($query);$i = 0;while($row=mysql_fetch_array($result)){$name .= 'name'.$i.'='.urlencode($row['name']).'&';$scores .= 'score'.$i.'='.urlencode($row['score']).'&';$i++;}echo $scores;echo $name;?>This code is from register.php:<?php$db=mysql_connect("loff-production.com.mysql", "loff_production", "Mypassword");mysql_select_db("high_scores", $db);$sql = 'INSERT INTO high_scores (name,score) VALUES ("'.$_POST['name'].'","'.$_POST['score'].'")';$result = mysql_query ($sql);if ($result) {$created = 'score posted for ' .$_POST ['name'];echo 'message='.urlencode($created);}?>This code is from One of the frames in my flash file:stop();var lowHighScore = 0;myData = new LoadVars();myData.load("get_score2.php");myData.onLoad = function(success){if(success){for(var i=0; i<10; i++){_root["n"+i].text = this['name'+i];_root["s"+i].text = this['score'+i];if(i==9){lowHighScore = s9.text;}}}else{trace("Error loading data!");}}This code is from another frame in my flash file:stop();if(score_txt.text > lowHighScore){message_txt.text = "Congratulations! Submit your initials and high score..."}else{message_txt.text = "You did not get a high score, please try again!";}player = new LoadVars();playerRegistered = new LoadVars();playerRegistered.onLoad = showResult;submit_btn.onRelease = submitScore;function submitScore():Void {player.name = name_txt.text;player.score = score_txt.text;player.sendAndLoad("register.php",playerRegistered);}function showResult():Void {message_txt.text = this.error;message_txt.text = this.message;name_txt.text = "";score_txt.text = "";_root.play();} Quote MultiQuote Edit Report
  6. hello, I'm in need of getting my high score to work in my game.I have some code in my Flash file and some code in my Php file as you may understood..I don't know if this is the place to say the flash scripting but I will post everything so you guys understand the script in the php abit easier. This code is from: get_score2.php <?php $db=mysql_connect("loff-production.com.mysql", "loff_production", "Mypassword"); mysql_select_db("high_scores", $db); $scores = ''; $name = ''; $query = "select * from high_scores order by score DESC LIMIT 0,10"; $result=mysql_query($query); $i = 0; while($row=mysql_fetch_array($result)){ $name .= 'name'.$i.'='.urlencode($row['name']).'&'; $scores .= 'score'.$i.'='.urlencode($row['score']).'&'; $i++; } echo $scores; echo $name; ?> This code is from register.php: <?php $db=mysql_connect("loff-production.com.mysql", "loff_production", "Mypassword"); mysql_select_db("high_scores", $db); $sql = 'INSERT INTO high_scores (name,score) VALUES ("'.$_POST['name'].'","'.$_POST['score'].'")'; $result = mysql_query ($sql); if ($result) { $created = 'score posted for ' .$_POST ['name']; echo 'message='.urlencode($created); }?> This code is from One of the frames in my flash file: stop();var lowHighScore = 0;myData = new LoadVars();myData.load("get_score2.php");myData.onLoad = function(success){ if(success){ for(var i=0; i<10; i++){ _root["n"+i].text = this['name'+i]; _root["s"+i].text = this['score'+i]; if(i==9){ lowHighScore = s9.text; } } }else{ trace("Error loading data!"); }} This code is from another frame in my flash file: stop();if(score_txt.text > lowHighScore){ message_txt.text = "Congratulations! Submit your initials and high score..."}else{ message_txt.text = "You did not get a high score, please try again!";}player = new LoadVars();playerRegistered = new LoadVars();playerRegistered.onLoad = showResult;submit_btn.onRelease = submitScore;function submitScore():Void { player.name = name_txt.text; player.score = score_txt.text; player.sendAndLoad("register.php",playerRegistered);}function showResult():Void { message_txt.text = this.error; message_txt.text = this.message; name_txt.text = ""; score_txt.text = ""; _root.play();}
×
×
  • Create New...