ActionScript 3.0 :: High Score Table Setup - If Statement With Variable

Feb 9, 2010

I am trying to get a high score table set up and I have it all working except for an if statement which decides whether to put a zero in the time or not.
ActionScript Code:
variable declared at the top
var gap:String;

This is getting data that is stored - it works fine except for the underlined "gap" - The "gap" is meant to be calling the variable which has the below if statement
ScoreInputScore.text=String(SpotTheDifferenceGame._minute)+gap+String(SpotTheDifferenceGame._second);
if (SpotTheDifferenceGame._second<10) {
gap=(":0");
} else {
gap=(":");
}

I thought by have the variable called in in the function and having the if statement with gap= it would do the specified text in the dynamic text box. When I put a trace on "gap" it traces with the correct text depending on what the number is but in my dynamic text box it displays as number null number.
// displays like this when trace put on it
:0
// displays like this in dynamic text box
2null02

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Make A High Score Table For A Flash Game Where EVERYONE See's The Same High Scores?

Oct 11, 2003

how can i make a high score table for a flash game where EVERYONE see's the same high scores?

eg.

Bill gets 1000 in USA
Ben gets 1002 in UK

they can see each others scores on a high score table.

View 7 Replies

ActionScript 2.0 :: Flash8 With High Score Table?

Dec 28, 2009

I need some urgent help with my high score table. My scoreboard was based of a tutorial that I found using php and flash to create a scoreboard. When I use the scoreboard in flash (using ctrl + enter) the scoreboard runs fine... It uploads the new name and score and reads the scores from the board then loads them to flash. But the problem is as soon as I try to use the created "*.SWF" file, it acts as if nothing is meant to happen... I click on the button to upload and reload the scores and nothing happens at all.

I loaded the file onto the same FTP site i'm hosting the scores and the PHP file and the scoreboard once again worked fine. Upon trying to post it anywhere else, the scoreboard won't work.

I have the local playback security setting set to "Access network only".

[Code]...

View 1 Replies

ActionScript 3.0 :: High Score Table - Ascending Order

Feb 9, 2010

I am creating a high scores table and is working fine except it doesn't like ascending. Can I not just change it to ascending?
ActionScript Code:
function to sort the list
currently sorts with highest time at the top
I want to have the quickest time at the top
function adding(evt:MouseEvent):void {
highScores.push([ScoreInputName.text,ScoreInputScore.text]);
[Code] .....

View 2 Replies

ActionScript 2.0 :: Make A High Score Table For A Flash Game?

Oct 11, 2003

how can i make a high score table for a flash game where EVERYONE see's the same high scores?

eg.

Bill gets 1000 in USA
Ben gets 1002 in UK

they can see each others scores on a high score table.

View 7 Replies

ActionScript 2.0 :: Creating A High Score Table In Flash Using External File Handling

Feb 8, 2012

Creating a high score table in flash, using external file handling, can be achieved using server-side scripts, such as PHP. However, as this is not allowed for my game (school project), I need a way to write a few variables directly to a text file and read it back again. Is this possible? I am using AS 2.0. Any other ways in which a high score table, which is portable and can be saved and updated

View 3 Replies

ActionScript 1/2 :: High Score Table Writing A Simple Text File With Flash And PHP

Dec 23, 2010

I am having a problem getting Flash to work with PHP as I need Flash to read and write to a text file on a server to store simple name/score data for a games hi score table. I can read from the text file into Flash easily enough but also need to write to the file when a new high score is reached, so I need to use PHP to do that. I can send the data from flash to the php file via POST but so far it is not working. The PHP file is confirmed as working as I added an echo to the file which displayed a message so I  could check that the server was running PHP - the files were also uploaded to a remote server so I  could test them properly. Flash code is as follows:

//php filewriter
var myLV = new LoadVars();
function sendData() {
//sets up variable 'hsdata' to send to php
myLV.hsdata = myText;
myLV.send("hiscores.php");
}
 
I believe this sends the variable 'myText' to the php file as a variable called 'hsdata' which I want the php file to write into a text file. The mytext variable is just a long string that has all the scores and names in the hiscore. OK, XML would be better way of doing this but for speed I just want to get basic functionality working, so storing a simple text sting is adequate for now. The PHP code that reads the Flash 'hsdata' variable and writes it to the text file 'scores.txt' follows:

[Code]...

View 7 Replies

Actionscript 3.0 :: Produce High Score Table For Online Game Using Document In Same Location?

Jul 11, 2010

I've been looking on the net for some time now (about 4 weeks on and off) and i've come across various ways of producing high score tables for both online and offline games. My query is:

Is it possible to produce a high score table for an online game using a document in the same location as the swf without using a PHP, SQL or any of the like languages? Either using a text document, xml, another swf or something else like that?

View 1 Replies

ActionScript 2.0 :: Create A High Score Table Offline That Doesn't Need Php Just Relies On Dynamic Textboxes?

Jul 29, 2010

I am trying to create a high score table offline that doesn't need php just relies on dynamic textboxes.I am basing it on a kind of random football results generator. I have been able to get the random scores and add points to a team depending on the score but now I would like to be able to display them in a 'league' table based on their points score.

View 7 Replies

ActionScript 3.0 :: High Scores Table Without Name Repeat

May 20, 2011

I have some code which fills a high scores table.. we've decided to give away a prize to the top ten people in the high scores table.. the problem is that people are playing repeatedly and fillnig the high scores table with their name, this makes it unfair to other players as they can't manage to get onto the table Is there a way I can modify my code to ignore the same name should it appear and skip to the next non repeated name(pseudo) and score ??

[Code]...

View 8 Replies

ActionScript 3.0 :: Make A High Scores Table Using PHP And SQL?

Dec 15, 2010

I can find many AS2 tutorials on how to make a high scores table using PHP and sometimes SQL, but none for AS3. a resource showing me how to submit the user's score, and if it's in the top ten, show it on that list? I have the local high score just set to a variable, but would love for that to be passed to my SQL table.

View 1 Replies

ActionScript 3.0 :: Localized High Score System

Jan 21, 2011

I have a game which I'd like to take to an exhibition for people to test on the stand, but my high score system is on the server at the office and there is no internet connection at the exhibition hall. I'm wondering what the best method of having the high scores would be.. would I need to install PHP MySQL onto my laptop and run the high scores locally, or is there another method I could adopt that won't take too long to set up... XML for example..

View 1 Replies

ActionScript 2.0 :: High Score Class With PHP Backend?

Feb 28, 2004

I have been getting mps about how I did my high score list in my footer ever since I made it. But because I didnt know any PHP back then the high score list in my footer is all Action Script except the writing to the txt file bit. It is still every buggy and doesnt work very well. So thats why I didnt what to give it to any one because I knew I would never hear the end of all the problems people would have with it. But seen as I have got better at PHP now I made a system where the PHP does all of the work. It works better and its dynamic. I made a flash class that formats the score to an array and can communicate with the PHP file so it would be easy to used.

[Code]...

View 1 Replies

Add Highest Score Table In My Flash Game?

Jul 27, 2009

I want to add highest score table in my flash game ? I want to upload my game to web so visitors can play on my page and see how good they were. Im working with as2

View 1 Replies

ActionScript 2.0 :: Can't Get A Movie Clip To Add To A Score Table

Jun 23, 2010

I can't get a movie clip to add to a score table I made with score++;, which is outside the movie clip.

View 2 Replies

ActionScript 2.0 :: Input Box, Hit Test And Score Table?

Aug 23, 2009

I am wondering how I would get a name from an input box<and present a message if box is empty(i.e. popup), store it and output it to another frame that has Well done <output box with name> you got a score of <score output box>I am also wondering how I would get names and scores and put them on a high score table. this is done using arrays i know... is it like if score>36 array or outputbox_1 = score1?

View 0 Replies

ActionScript 2.0 :: Submitting High Score To Remote Server?

Nov 15, 2009

I am wanting to have a high score function at the end of my game. My code is generating a URL, but is then appending it with &onLoad=%5Btype%20Function%5D which is making it fail. If I past the code manually into a browser, removing &onLoad=%5Btype%20Function%5D from the end, it works perfectly.The URL that is being created is:

[URL]

My code is:

System.security.loadPolicyFile("C:path....crossd omain.xml");
var score:Number = 1001;
var hsname:String = "FlashTest";
function addHighScore(returnFrame:String, name:String, score:Number, code:Number) {

[code]....

View 2 Replies

ActionScript 3.0 :: Flash - Make An Online High-score?

Mar 4, 2011

I have a question concerning high-scores.So I'm running an internship at a museum right now and I have made a game that currently saves high-score data through a SharedObject. However, they would rather have it stored online so people can see their scores at home after a visit to the museum, instead of having their own personal local top-10.What is the best way to do this? I was thinking of using mySQL or something of the same sort, yet I have 0 knowledge as to how that's done

View 1 Replies

ActionScript 2.0 :: Submit User Score And Name To Database Table

Apr 22, 2008

I am basically having a problem in submiting the users score and name to the database table. When the user reaches the final score screen they are shown two dynamic text boxes that display there total result and a input text box where the user can enter their name. I have done everything and it still don't work. I know I can receive the data but I don't get why it doesn't submit it to my table.
The input text box has a instance name of "playername"
Score total dynamic text box 1 "correct_total"
Score total dynamic text box 2 "wrong_total"
I have also attached an image of my database table [URL].

PHP files. insertValues.php
<?php
$host = "localhost";
$user = "root";
$pass = "";
$database = "activitysystem";
[Code] .....

View 3 Replies

Actionscript 3 :: Flash Game - High Score With Graphics Not With Text

Jan 1, 2010

is it possible to use graphics (the numbers 0-9 in one png-file) instead of a Textfield to show the high score of a game to the player? With a TextField it is easy to "refresh" the score but what can I do, if I want to use my png-files for the score? Is there a simple way to do this? How are other flash game designer do it?

My current solution (not tested, just in my head) is, to create 10 bitmaps (numbers from 0-9) or 1 bitmap with all the numbers in it and then convert the current score into a string, split this string and for every digit show the matching bitmap. Update: or should i try to use filters on the textfield to create a "more beautiful" score?

View 2 Replies

Make A Quit Feature & Maintain High Score In A Flash Built Android App?

Jan 6, 2011

I created a game in Flash and outputted it into an APK file for use in my Android phone. I would like to make a quit function so that it quits the game application when you leave.

Right now, I have to quit using task manager in my mobile. Also how do you enable it to maintain a high score in the game so that next time the user plays the game again, the high score is still there? Right now, the highscore is lost when you quit the game application.

View 1 Replies

ActionScript 2.0 :: High Score List - Flash Cannot Create A Simple Text File

Aug 17, 2004

I want to create a simple high score list of 10 high scores of a game. From reading the forums I seem to get the idea that flash cannot create a simple text file. I don't have php or asp but do have cgi capability. Does anyone know where I can find a simple cgi-script that will allow me to write the text the cgi receives to a simple text file: game.sco I want to be able to write a single long string to it so that I create a string of values and can load it back in using flash loadvariables. I can create the string in flash... but how do I write it to a text file using a cgi script? the text file would include this string...I already know how to read it and split it to parse it into arrays:

[Code]...

View 1 Replies

ActionScript 2.0 :: Keeping Score With If Statement

Dec 15, 2010

I'm having an actionscript 2.0 problem with keeping score. I have a dynamic text box with a variable called score. I have the following action code for that variable:

_root.score = 0;

For the correct answer button I have this action:

_root.score = Number (score) +10;

This works fine to increase the score by 10 for each correct answer. The problem is that I can't get an if statement to work for when the score reaches 150 to gotoAndPlay a certain frame. I've tried various syntax, I've tried it on the action for a button and an action for the timeline with:

onRelease = function () {

(My learning game is set up to allow for users to answer up to four extra questions to reach the score of 150). Nothing has worked so far.

View 5 Replies

Actionscript :: Add Score Tracker In An If / Else Statement For Multiple Choice Game?

Dec 12, 2010

Where and how I'd put the rest for the score tracker? I'm going to be making 3 of these multiple choice questions, so what would be the best way I lay that out and transition from one question to another?[code]...

View 1 Replies

ActionScript 2.0 :: Flash8 Variable Set-up - 'if' Statement To Run From Variable When Playhead Encounters MovieClip

Aug 21, 2009

I want to declare a variable on the main timeline that can be called from anywhere in my movie. So, _global var should be the right approach. I want to declare a movie clip 'MC1' "open", or "closed" so that when it is revisited, my flash file knows the user has been there before and performs a different task from the one it does when 'MC1' was first encountered. So, i need a 'if' statement to run from the variable, when the playhead encounters the movieClip.

[Code]..

View 2 Replies

Swf - Getting Value From Score Variable In Flash?

Aug 25, 2011

I am editing a flash game,I want that whenever user press the submit button,his score should be saved in the database at my Server.How i can achieve this task?I had got the variable in which score is stored.I can i send this to my database.

View 1 Replies

ActionScript 2.0 :: MovieClip Table - Saving Variable With SharedObject

Jun 24, 2011

I am using a movieclip "table" that is attached on the enter frame event at the main scene. I am trying to save variable "money" and I use this code inside the movieclip, when I test the movie it shows me money1 as undefined and I cant find why! I have used _root. and doesn't work.

PHP Code:
var svar = sharedobject.getLocal("MY VAR");
svar.data.moneynew = money;
svar.flush();
money1=svar.data.moneynew;

View 1 Replies

ActionScript 2.0 :: Setup A Variable Then Export It To Text?

Jul 14, 2003

I want to save variables to txt file. I have found that this can be done by using the FSCommand save (undocumented command). The problem is im not sure how to do it.how to setup a variable then export it to txt.

View 8 Replies

Actionscript :: Use Argument As Variable Within Variable Statement?

Apr 14, 2011

This may be an obvious search, but I'm not totally sure on the proper syntax... basically what I want to do is:

private function makeISchedule(data:Array, label:String = null):ArrayCollection{
var arr:ArrayCollection = new ArrayCollection;
for (var i:int = 0; i<data.length; i++){

[code].....

View 1 Replies

ActionScript 2.0 :: Send Score Variable To Email Or Mysql?

Dec 7, 2009

I've decide racing car game! and I want to be able to send the score to send to a mail box or send it to a table in php or database! at the moment I can send the Score Variable to be display in PHP but its not the way that I want!

Script that send the Score to php
submit.onPress = function () {
getURL ("getVars.php", "_blank", "POST");

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved