Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Detecting Score..how?



I did the basic Flash 5 arcade tutorial and decided to keep going with that. What i need to know is how do write in action script if score is 500000 gotoAndStop at scene 2? Im a newb, please help!!



FlashKit > Flash Help > Flash General Help
Posted on: 06-25-2004, 10:47 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Detecting Score?
I was wondering if there was a way to detect the score? I was thinking of getting to a certain score then moving onto a new scene/level and each time it getting a little harder. My Question---How do I have it detect the score and put it into actionScript so that it goes from Scene 1 to Scene 2?

Setting Variable Score = Score + 1 Justs Adds Another Digit With 1
I am trying to work on how to add 1 each time to a text. I used the variable name score and a button has this command :
(on pressing the button) score = score + 1

It changes the text of score but each time you click it, it adds a new digit. this is the example of the first four times.

0 01 011 0111

Can anyone help me? My goal is to make it become

0 1 2 3 and so on.

Thank you

Save Score And Put In Array To Pull Up All Score Later
Can you help please. I am new to this.
I have a list of people who answer 3 questions on 5 different topics. I can total their scores on the topic individually.
How do I total the first topic and show them and save their answers and go to the next topic and show their answers and next and so on and then get all the questions they answered for each of the 5 topics and their final score?

with thanks

Best Way To Add A Score To A Score Box And Total It Up.
I am creating a game for children to make good food choices for breakfast, lunch, dinner, and snacks. I need to have the food choice add a value to a score box when clicked onto the plate and subtract the same amount when clicked off. So far, all I have been able to do is get the score to appear in the upper left hand corner. When I can get the pancakes working properly, I will be adding other foods which will do the same thing with different numbers. The total score cannot go over 100. I am attaching the .as code, but it is separate from the .fla and I'm not sure if I can upload the .fla here.







Attach Code

package
{
//import any class being used by this package
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.MouseEvent;

public class MealGame extends MovieClip
{

//altered version
var pancakes1:Pancakes;
var offPlate:Boolean; //variable for food off the plate
var gameScore:int = 0;

public function MealGame()
{
//Create a score field for the pancakes.
var gameScoreField:TextField = new TextField();
//Show the score field
addChild(gameScoreField);
var tf:TextFormat = new TextFormat();

//Create a new instance of the Pancake class.
var pancakes1:Pancakes = new Pancakes();
//Display the pancakes on this stage.
this.addChild(pancakes1);

//Position the food item.
pancakes1.x = 11;
pancakes1.y = 42;
offPlate = true;

//make the food item a button
pancakes1.buttonMode = true;
pancakes1.addEventListener(MouseEvent.CLICK, onClick);

//toggle the food item to put on plate or off the plate
//toggle adding to the score or removing from the score
function onClick(event:MouseEvent):void
{
if(offPlate)
{
pancakes1.x = 119;
pancakes1.y = 380;
//add to score
gameScore = gameScore + 50;
gameScoreField.text = " " + String(gameScore);
tf.font = "Arial";
tf.bold = true;
tf.color = 0x000000;
tf.size = 22;
//tf.x = 426;
//tf.y = 530;

//Take this text formatting object; apply it to the textfield
gameScoreField.setTextFormat(tf);

//toggle the offPlate value
offPlate = !offPlate;
}
else
{
pancakes1.x = 11;
pancakes1.y = 42;
//remove from score
gameScore = gameScore - 50;
gameScoreField.text = " " + String(gameScore);
tf.font = "Arial";
tf.bold = true;
tf.color = 0x000000;
tf.size = 22;
//tf.x = 426;
//tf.y = 530;

//Take this text formatting object; apply it to the textfield
gameScoreField.setTextFormat(tf);
offPlate = !offPlate;
}
}
}
}
}

[F8] From Text "_root.home.score" To Variable _root.home.score ?
Hej

How can i convert this string "_root.home.score" to a varialbe, so i can use it for actionscripting

Score
does anyone here knows how to do this effect?

the score is incrementing by 10 but I want it to show in such a way that i can see it increase from 0 to 10 in a very fast speed.

For example when i shoot a bear, my score will be 10. I want to see it increase from 0 to 10. the second time i shoot a bear my score will be 20 and again i want to be able to see that it is increasing from 10 to 20.

Any ideas??

Score Help......
I need to try and make my game go to the 4th frame when the score reaches 10. The variable name of the score text field is "score", the frame i want it to go to is 4.

Please help me.

Score :: Help
Hello Flashers,

I have a client who want me to do a skill testing question game. I have 10 questions with a,b,c answers. When the user answers right they get 10 points, if wron nothing.

I have a dynamic text box with a varialble name "score". in the first frame of the movie I have the action:
/:score = "0";
When the user click the right answer it adds +10 to "score", simple enough.

My problem is at the end of the quiz, we want to put a phrase depending on the score, like "you suck" if you get 10 points or "great job" for 90 points. How can I control a tellTarget or a dynamic text box to display a phrase depending on the total of "score"?

The .fla file can be downloaded here> http://www.epochwebdesign.com/flockrelief/game1.fla

Thanks

Score
I have a score-system for a game that is not working right.

The score works well when I delete a point, but not when I add a point. The problem is that when I add a point, it just adds the point to the end of the number that allready is in the score...

Example:
Lets say I have 10 points, and need to add a point. I want it to be 11, but instead it becomes 101.

This is the code I am using:

-This is working fine:
_root.score2.score -=1

-This is not working:
_root.score2.score +=1

Has anyone had any experience with this sort of problem?

Thanks in advance!

Get Score?
HEY SOMEONE HELP ME, I'M TRYING TO MAKE IT TO WHERE THIS FLA FILE CHECKS THE SCORE AND AFTER A CERTAIN AMOUT GOES ON TO THE BOSS SCENE, IF YOU HAVE AN IDEA ON HOW TO MAKE IT WORK, ANY INPUT WOULD BE MUCH APRECIATED, THANKS

Simply


-----------------------------------------
SimpMail

If Score, The?
How can I make it so in my game if the dynamic text is 4 (in other words if the score = 4) that then it would go to another frame?

Score
I want score for a pong game to work...
Pong
i have a variable winnerright which is the computers scoreboard
and just have winnerright+=1 when the ball's y<0 but it doesn't work...
I used tracing and know that the ball y<0 part works but not the other...thanks

Score = +1.... Isn't It?
Ok, so I have a dynamic text field that is your score for the game. It starts at zero, and every time you do something correct I want it to go up one. So isn't the correct action script score = +1?

HELP!

Score Once Again
ok. still having trouble with the score. i want it to NOT be in the bullet movie clip but still to add 1 onto it every time the bullet hits the bird. i'm once again attaching my fla file! hope you can help!

Help With Score
Im pretty new to flash and only have a basic understanding .
Im trying to make my game score work like if score is 1000 or more goto and play etc etc, i have only goten it to work if it is 1000 exactly and i cant find a tutorial that helps with what i need only 1 with a button and i am using movie clips this is probably bin asked before but i cannot find it around the forums, Thanks in advance

Score Bar
I have a design in flash, where in i have different countries flag in a row with a bar in front of them. Now what i need is too show some game score over the bar and need that bar to scroll dynamically according to the score just like a bar graph, where we put figures and it scroll further.

what I required is to use a external text file where i can update the scores in text file and it will automatically update in flash, may be xml will help. Please help me in this out.

[f8] Score?
Hi,

I was doing a scores tutorial an i have followed it step by step. There are only 2 components, 1 button and 1 text field

i have added a var called total to the text field and the action script on the button is -

on (release) {
_root.total = _root.total + 100;
}

but when i run it all i get is -

NaN

Why would this be?

Regards,
Lee

Score Help
Ok, i solwed this prob, pls delete this topic

[MX] Score
Hello

im using this code:

onClipEvent (enterFrame) {
if (_root.rollingscore<_root.score) {
_root.rollingscore += 1;
}
}
on (press) {
_root.score += 10;
}
onClipEvent (load) {
}


****
And what i wanna do is when you click this it takes you to a new frame is that possible? THX for the help

How Do I Add A Score
Hi everyone,

Im creating a quiz and i would like to know how to add a score to the quiz.
Thanks for the help.

[CS3] Help With Score
Hi.. i am making a space shooter game and i want to put that when the score reaches 100 points the game will go to frame 3 but i dont how to put this.. please help me
I hope that you will answer me

pd:sorry for my english

Score Help <_>
Code:
var score:Number = 0;
//stuff

function checkScore(score):Void {

if (score<=20){
//stuff
}
}

//Button
help.onRelease = function() {
score += 10;
checkScore(score);
}
none.onRelease = function() {
score += 5;
checkScore(score);
}
unhelp.onRelease = function() {
score += 1;
checkScore(score);
}
abuse.onRelease = function() {
score += 0;
checkScore(score);
}
Yet my buttons are on a diffrent layer.
How can I get the buttons to effect the score while keeping them on a seperate layer?
Do I move the button code to the layer that the buttons are on or what?

Score
Hi everyone,
Im creating a quiz and i was wondering how i put a score on the quiz.
I know how to do in on as2 but it seems abit different on as3.
Is there any help that anyone will be able to give me?

Set Score
i hav a dynamic text box with a variable name of total

how do i make it so it ses 0 before you start
then when things hittest it adds 1 to the score

for 0 before you start i though:

Code:
_root.total = 0;
and for +1 everytime

Code:
if (bullet.hitTest(enemy)) {
_root.total = _root.total + 1;
}
the first 1 dousnt work but i havent tried the second so would it work?

Score
i ant my MC(monster) to attack the player and lower his score

How To Do?Score + 1
does anyone know the code of for example when the user drag the ball on relase if it hit the board than there will be a score counter saying 1 point the ball will fly at random speed just like throwing a basketball plss help thankzz

Score
Hey I'm creating this guitar hero movie with flash mx 2004. I'm having trouble finding a way to increase the score for every frame a note comes by without having to edit the score frame by frame. Any solutions?

Set Score
i hav a dynamic text box with a variable name of total

how do i make it so it ses 0 before you start
then when things hittest it adds 1 to the score

for 0 before you start i though:

Code:
_root.total = 0;
and for +1 everytime

Code:
if (bullet.hitTest(enemy)) {
_root.total = _root.total + 1;
}
the first 1 dousnt work but i havent tried the second so would it work?

PHP Score Board
Hi

Can any one point me in the right direction of a PHP score board. I have a flash game which I want to parse the 'score' and 'name' variable to a PHP script which then displays a score board. I have MySQL installed on the server so it should work fine but I'm struggling to find the script.

Any help welcome!

Thanks

K

Score System
Can anyone tell me how to create a score system? I really need one. Thanx

High Score
I cant get my high scor list to work. I got Mysql and PHP
Please give me a hint on how this works ! Stay cool Harboartas.com

Score In Shoot 'em Up
i don't hope this question it to n00p, but i'm making a 1'st peron shooter in flash 5, and i have made alle the chars (the one who have to get shooted) as buttons, so now i wanna' know how do i make a score than increases when i press these "buttons" or should i convert 'em to somethin' else than buttons, i just want 'em to get shot and then add 10 points to the score. i hope you can help me i don't know annything 'bout scores so it could be nice with a little help also 'bout what type of text the score should be, i know there's diffrent types. and if there have to be diffrent points for diffrent figures how do i do that then? please, i hope you can help me!



HeXaR

Score Count
How do I keep score in my game?

Dice Score
Hi,
I have these dice that are random:

http://leadminepond.com/tests/diceShake.html

Basically there are 6 movies of dice and 2 of them load randomly at a time.

I would like to have those scores tallied and posted some where on the screen. I would like to be able to display the scores for 6 rolls of the dice. Any ideas

Thanks a bunch you geniuses!!

John GLynn

Score Keeper...
I'm makin a sniper game, and each guy you can kill is a movie clip, inside the movies clips are buttons, when you click the button it takes you to the death part of the movie clip and it keeps rotating like that. I need to make a text box that goes up 1 everytime you click the button that is the guy that dies, or go to the death part of the movie clip. I'm not sure if I explained this well enough but if I did please help, thanks.

Totting Up A Score
Hello there everyone. If they say a little knowledge is a dangerous thing, then I am dangerous!!!!! I have a question, and to be honest I haven't searched through the tutorials because I don't really know what I'm looking for (told you I was dangerous). Anyway, to my question...

I'm creating an interactive quiz in Flash 4 for my website, and so far so good, but what I want to do is add up the total of correct answers by the user to give a grand total at the end of the quiz. I know it can be done, but I don't know a variable from a dirigable, so if you can help, you have my permission to speak to me as though I'm an idiot... just so long as I understand LOL.

If it's any help, you can view the quiz on my site at http://www.morgueazm.co.uk and if you're not a metalhead, please don't be offended by any of the content on my site.
Thanks in advance.

The Score In A Game
Situation - i have a flash game that ends with your score in the final frame in a small box in the corner of the screen

What i'd like - For a larger display of your final score to show up.

Problem is - I'm just not sure how to get this larger dynamic text box to read the final score and just present this score it in a larger size.

Thanks!!!!!!!! :-)

Game Score
I have made a game where i get 10 points everytime i hit a enemy.

Im sure my question i quite easy, if statement wont work

I want the game to end when i get a certain amount of points.

if (points == 20) {
gotoAndPlay (6);
}

but it dont work..

Can anyone plz help, if i manage this my game is complete


Thanks

Synthieboy !

Combo-score
I need a suggestion here. I'm developping a game with about 6 different moves/actions to score points. So far so good. But now I want to insert a 'combo-score'. This combo-score can only be scored when the player first does move1 (with succes), then move3 (with succes) and then move5 (with succes). The moves have to be made in that particular order and no other move is allowed between them. I've tried some stuff, but I... argh!!! So if there is a whizz out there, give it a try!

If...else And Score Problems
Hi there! Hope somebody can help me! I have made 5 draggable clips with instance names: clip1, clip2,clip3,.. and 5 targets: target1, target2, target3,... I´ve programmed it so that each clip can be dragged an dropped on any target. But only one combination is of course right (clip1 = target1, clip2 = target2..etc)
My problem is that, when the user has placed each clip over each target I want the user to push a "check your answer" button to be able to see a list of right and wrong answers, the final score and different funny movieclips depending on what the score is. For example:

Clip1 INCORRECT !
Clip2 CORRECT !
Clip3 INCORRECT !
Clip4 CORRECT !
Clip5 CORRECT !

You scored 3/5

"FUNNY MOVIECLIP"

------------------
Thanks in advance!
/V

How Do I Display A Score Of Zero?
I've gotten to the point where I can display a score at the end of a Flash quiz including 'score-appropriate' comments such as: "You're a Flanders!" (if they do well, of course) or "D'oh!" if they do poorly.

But what if they score a Zero, get none right. (Moe?) What script do I need to return a score of '0' at quiz end?

Thank you in advance, you scripters of Great Knowledge...

Send Score
how would i be able, so that on my flash games so that the game can go to sendscore.php and do a mysql_query to send the score to the db?

Score Table
How would I create a table that adds +1 after i collect an item in a game?

Flash 5 Score Help
I have a shooting game i am making where the enemy gradually drains your health, and I want it to go to Scene 4 (the game over screen) when your health is down to 0, I have the health number up and running, but this code is bothering me;

if (Health==0) {
gotoAndPlay ("Scene 4", 1);
}

I think that is the coding, but it wont work, what is wrong with it please?

Score Board
how do you do a scoreboard in flash mx, ive looked at tutorials and there is none there that can help me so what should i do?

Score Display
Hi.

Im making a swf with a duplicate MC and the mc name and position depends on a value of a variable and the duplicated mc dislays a certain input but i cant seem to get it to work could someone please take a look.
Please.

Score-Keeping
let's say I have a simple Roullette game. I am having trouble with scoring. I want the gasme to start with 500, then subtract a bet amount and add the win amount. I have tried this bu keep on running into a brick wall. Any Ideas.

Thanks
Harry

Game Score
in really struggling with a simple game score. i want it to be able to input players name and the present the result on a score boared. Updated as scores increase.

does anyone know a good flash game site or source code i could look at to help me out.

cheers.

_root.p1.score Possible?
I want to have a series of variables for dart players. Like:
p1.score
p2.score

p1.20
p2.20

p1.19
p2.19

etc
etc

Is this possible?
Mark

Copyright © 2005-08 www.BigResource.com, All rights reserved