Search: Key Word(s): score
Showing results 1 to 25 of 382
Search took 6.47 seconds.
Code:
onClipEvent (load) {
var one = 0;
var ten = 0;
var hun = 0;
var tho = 0;
var tentho = 0;
var huntho = 0;
}
onClipEvent (enterFrame) {
if (_root.scoreHolder>0) {
_root.scoreHolder--;
if (one+1 != 10) {
one++
} else {
one = 0
if (ten+1 != 10) {
ten++
} else {
ten = 0
if (hun+1 != 10) {
hun++
} else {
hun = 0
if (tentho+1 != 10) {
tentho++
}else {
tentho = 0
huntho++
}
}
}
}
}
_root.score = huntho+""+tentho+""+tho+""+hun+""+ten+""+one;
}
Leave a blank MC offstage with this code in it. Then whenever a player scores points, add those points to _root.scoreHolder instead of directly to the score.
Last edited by ImprisonedPride; 11-16-2006 at 01:11 PM.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD WEI Score: 7.6
I have searched that before and never found this code about it
Sorry and thanks
Is it easy to change the speed in which it goes up, perhaps flicks through tens instead of ones? I've tried but so far I only managed to make it go up to 1000 by mistake
[EDIT]: Hmm..when the score gets to 1000, the rolling bar jumps to 10,000. Gonna try and figure out whats wrong :S
... well masking out is ... an interresting approach ...
or you coud use this:
Code:
/**
* returns a string formated to the total length of Size
* padded with leading zeros
*
* @param value an object (text or number) to be padded
* @param size [optinal] the length of the resulting string
* @return the padded string
*/
function format (value:Object, size:Number):String {
var stringValue:String = String(value);
var strLength = 2;
if (size != null) strLength = size;
while (stringValue.length < strLength) {
stringValue = "0" + stringValue;
}
return stringValue;
}
// usage:
trace( format(1) );
// outputs: 01
trace( format(123, 5) );
// outputs: 00123
if you're on AS2 you colud just use the attached StrUtil class, which contains some more string related thingies ... (rename to .as, though) - wow my first open source.
Calm down Xareox.
You obviously didn't read what was above ihoss's post because some guy named 'domyboy' spammed in this thread...He wasnt attacking you.