ActionScript 2.0 :: [Flash 8] Getting Variables For Score Counting?
Nov 24, 2005
I am creating a simple game where you must remember the name of a number of people. On the stage is a table with faces. Text appears, asking who, for example, "Mike" is. You then have to click the correct face. The questions appear randomly.I have come this far, but what I want to do is the following:
1) Restrict the number of random questions, presumably by adding a variable, with the value incrementing by each question, and tells the movie clip to go to the "game results" frame when reaching a certain number.
2) Keep track of the number of questions answered correctly/incorrectly. I suppose this is also done easily by adding a value for number of incorrect answers, which is increased for each incorrect answer, with the amount of correct answers being calculated like (total number of questions)-(incorrect answers).
3) Display the number of correct and incorrect questions on the "game results" frame. For example "You answered X number of questions correctly, and Z number of questions incorrectly".
I know that the pieces of code below should be used, but I don`t know how to put it all together, or where to put it. I suppose the main code should be in the first frame, and some should be in the buttons.
Code:
var questionsAsked:Number;
Code:
myValue++;
Code:
if (questionsAsked == 20){
gotoAndStop("results");
}
Here is my code: var vi3585 = 0; var loader:URLLoader = new URLLoader(); //telling the loader that we are dealing with variables here. loader.dataFormat = URLLoaderDataFormat.VARIABLES; //This is an eventlistener loader.addEventListener(Event.COMPLETE, loading); [Code] .....
I have dynamic number of files inside a folder. Every file has 2 variables in it vt11 and vt11s. I need a script that checks if the variables in the files have certain values and if it has this value than it counts this file. Basically what this script does is that it counts how many files in the folder have the same 2 variables in it and than displays this number in the text box. The above script always shows 1, no mater how many files with the same 2 variables are in folder.
1) Have a textfield that counts from 1 to 315 2) Once the value of the textfield reaches 315, pause for 2 seconds, and loop. 3) Do this until 15 seconds have passed, then stop.
What I've done so far to try and get this to work:On frame 1, I set up a little script like so:[code]The problem is, once it loops back to frame 1, my textfield that is being displayed continues to display 315, it won't display the counter going from 1 to 315. EVEN THOUGH IF I TRACE IT, you can see the script is working in the background just fine counting from 1 to 315 3 more times before 15 seconds is reached.Any idea why my textfield would be displaying the end value and not displaying the start (counter) value as it should?
I made a .fla file that uses an "include" to pull in a bunch of variables from a .as file. I would like to be able to count the number of variables in this file so that I can make the thing more "automatic" so that if someone else in my office adds more variables to the .as file it updates itself. Similar to the way you can count children using an XML file.
Im designing my own game in flash, iv set up a score text box and it works fine. Except i just cant seem to get it to gotoandplay another frame,scene, when it hits a certain score??
i am building a shooting game and i was wondering if it is possible to have the movie go to frame 3 if the score = 500.I.E Score is displayed in a dynamic text box and everytime the enemy is hit the:
_root.score +=50 ============= on the first frame of the film i have the code
I created a timer with found tutorials and the Flash help files and everything works fine. My timer counts up from 000.000,0 to 999.000,0. Now I would like to also be able to do the same, but counting down from 999.000,0 to 000.000,0 Easy enough I thought, but now . how to make some modifications in my code to count down.
My code for counting up is the follow:
Code: Select allvar hours:Number = 0; var seconds:Number = 0; var minutes:Number = 0; var pauseTime:Number = 0;
I have a result screen that shows bonus points and such. I want each text field to increment one after another and also have it increment by a certain amount each frame. Result Screen pops up. First is the player score check the player score, is it more than the score we want to display if the player score is greater than the player display score by 100 increase the player display score by 100 if the player score is greater than the player display score by 10 increase the player display score by 10 else increase the player display score by 1 when finished move to the next score...and so on. I have thought of using timers to move from one score to the next, but not being in an Event.ENTER_FRAME it only does one if then moves to the next one.
Also the if statement for incrementing the score looks ridiculous and I'm thinking there has to be a better way to do it. I was thinking of making it a separate function but then I wouldn't know what to return, or how to return it so it looks like its increasing and not just showing the total number instantly. I'll try to expand on it a little more.
how I can count the number of clicks that people have made on a link in a flash movie. Not just the number of clicks one person makes within the movie but the number of clicks everyone has made
I have an object that rotates based on the mouse positionand I'm trying to count the degrees as it rotates.for example if i rotate 200 degrees cww the degree measurement is 200if i will rotate another 350 degrees cww the degree measurement will be 550now if i rotate 150 cw the measurement will be 400 now.I have this code: (it counts radians, but it is the same idea)p1 = mouse position
I have a little problem with counting all elements on stage. Flash, unfortunately is counting all objects on the stage without drawn objects (all shapes, including drawing objects, rectangles etc) all missed. Is there any way to count them?
Here's my code so far. It works without errors so far, but I hope the arrays are setup right. What I'd like to happen is:
1) When the user has clicked on 4 holes in any order, the 'welldone' box appears. code to insert: addChild(welldone);
2) Since the order is random, I have a dynamic text box at the bottom of the stage. I'd like the words: one, two, three, four.. appearing in the textfield in that order.
It could be very simple or quite complex
var welldone:MovieClip = new Welldone(); var clipArray:Array = [hex1, hex2, hex3, hex4]; for (var i:int = 0; i < clipArray.length; i++) {
I have an array example from a Flash Connection tutorial, and I'm wondering if there's an easy way to add a bit of code to count through the user's clicks.
What I'm trying to do is count the clicks, so that once someone has clicked on all 5 buttons, something happens.
Code: var clipArray:Array = [home_mc, about_mc, products_mc, services_mc, contact_mc]; for (var i:int = 0; i < clipArray.length; i++) { clipArray[i].buttonMode = true;
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.
problem is the score board is shown at the beginning if requested and at the end to show your score when the game is finished. The problem I have is refreshing the scores (replacing the current text in the boxes) rather than just adding the text again into the dynamic text boxes..Here is my code :-
var tab = "game1score";// update for each game // game2score, game3score.... var filesend = "receive.php"; var modesend = "post";
//This is called when the high scores are viewed at the beginning of the game
Over the years I've become an uber-nerd when it comes to flash game development. Now I'm thinking about looking into using my skills for helping other game-developers out there.I want to develop an API in AS3 which will allow the developer to do (as a start) the following:Display a dialogue which lets the user log into their "account" (hosted on my site).Send a score/value to the website and attribute it to the logged in user.Unlock an achievement (achievements will be set up by the developer in the web interface - which is where they will also get a key of some type to use with their API.Display highscores, other players profiles in-game, etc (show basically any stats in-game).All easy enough to develop straight off the bat. However; where it becomes frustrating is security. I'm not expecting an indestructible solution that I'm fully aware isn't possible, but what would be the most defensive way to approach this? One thought I've had was converting my API to a component so there's no access to the code (unless you decompile). The problem here is it's just not friendly to the developers, though it would allow me to create my own graphics for the UI (rather than coding many, many sprites).Private/public keys wont work unless there is very good protection against decompiling.
I'm building a flash-game-site for a while. The big trouble is Secure Score Submitting System .I search on the net and find some ineffective techniques:
-Secret word method: there is an secret word (crypto pass) on the server and flash gets it from server and uses for crypting score data then sends it to server. But the algoritm that does the crypto job, can be accesible with a swf decompiler. Also getting the secret word from server outside of flash is simple. Not safe!
-HTTP_REFERER method: php (or what else) check HTTP_REFERER data to determine where the post coming from. But with a simply firefox extensions, the referer header can be changed. Not safe!
That is my own idea but can only make cracking harder, not more:
-We can get flash vars with js (:swliveconnect) and send to server. Flash just make a fake submit that makes no effect. Just a trick. But not safe
I've been fiddling around with the flash quiz template and it's pretty much what I need to a point. But I really just need is to know how to keep score?
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
Iam trying to make a flash counter for a shooting game where each time you shoot a enemy you get 10 points. Does anyone know the code for score counting. I have made a dynamic text box with the word "Score" in it.
I want to create a very simple game for school. The user chooses answers based on questions, at the end the software presents some choices to the player based upon what they said. They have to choose food they like to eat, and the game tells them about the diet, they have 9 choices.
I wonder how I should keep track of what they player chose, and how to come up with the result based upon those choices. I made it with a score, so each answer had a value, but various arrangements of answers had the same score.
I am working on a flash game which is a shooting egg game. I want to export a score(what ever it may be ) to the xml file so that using php developer can take it from there n post it to the wall just like we play games on facebook n it asks you that "Do u want to post your scores?". The variable of Dynamic text box is score.
I wonder whether anyone knows of a solution to this: I want to embed a Captivate 4 quiz in a flash CS4 file and retrieve the score from the Captivate SWF so that I can use it in my flash file (AS3)- does anyone know a way of doing this (?eg. shared objects?). Communication between Flash and CP seems to be a lot more problematic than I anticipated.
I want to know about hacking a flash game...like in a flash game how to hack to increase your votes or score ... As there are flash games in Facebook,how to hack them
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
The game will be on a school VLE (virtual learning environment) like 'Moodle'. Can you export to email? Spreasheet? Or can it only be done with php? Do not want to be spending weeks on it!
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?
there is is simple Game ( kids multiplication )game will be on Normal website How I can share Game score over Social networks like Facebook without using PHP or any server-side scripting directly from Flash ?Game is also just XML based game just in the end I want to share User score and website link to any social-network where user want