PDA

View Full Version : yet another question



ss4omnislash
February 2nd, 2002, 07:00 PM
is there a way to make a score box for a game that goes up by more than 1

upuaut8
February 3rd, 2002, 12:58 AM
yes there is...


oh you want to know how?? ;)

A text field will just display what ever variable is assigned to it.. if you update the variable, then the text box will update.

probebly the best way is to have a function defined in frame 1 of the main movie Something like

function score (){
scoreTotal++;
}

now, anytime you put
_root.score();
in anything from a frame, to a button, it will call that function, and make the variable called "scoreTotal" go up by 1 every time it is called.

A text field anywhere with a variable name of "_root.scoreTotal" will update anytime that function is called.

ilyaslamasse
February 3rd, 2002, 06:02 AM
My understanding of the question is : can I make so that when I do something, the score goes up by 5 for instance.
Just replace ;

function score (){
scoreTotal++;
}

by

function score (){
scoreTotal += 5;
}

in the last thread.

0] pom

upuaut8
February 3rd, 2002, 03:28 PM
didn't I say that? ;)

ilyaslamasse
February 3rd, 2002, 04:04 PM
Hey, stop drinking beer, Upu. Try Mountain Dew instead. I heard i t's good :cool:
pom 0]

upuaut8
February 3rd, 2002, 06:27 PM
I only drink Merlot.. :)

Phil Jayhan
February 3rd, 2002, 06:32 PM
Me and Pom left you a gift in Random. You should check it out. Doh!

pj :evil:
:rollin: