i was just wondering, i have a dynamic text with 0000 inside.
in swf, nothing appears.
is there a way to see that numbers without putting "0000" or something else?
Printable View
i was just wondering, i have a dynamic text with 0000 inside.
in swf, nothing appears.
is there a way to see that numbers without putting "0000" or something else?
No there isn't without the parenthesis. Flash believes that it is helping you by shortening it.
-genesis f5
i don't quite understand what you are trying to do
but is this any use
Code:makeup = function (tstring, maxLength) {
tstring = tstring.toString()
var trailing = maxLength - tstring.length;
for (var i = 0; i < trailing; i++) {
tstring = "0" + tstring;
}
trace (tstring);
};
// makeup(number you want to display, length of output)
makeup (1, 5);
Update
I was able to add the 4 "0"'s without the parenthesis. All I did was put the numbers the dynamic text box before loading it.
I stand corrected. However, if you were to use actionscripting to do the job, you would need to use parenthesis.
or use trickman's example, lol---^
-genesis f5
2 minutes, 3 (!) replies ^^
thanks a lot.
He wants a number that always has like four digits.
Like: 0001, 0002, 0108, 2625, etc
And in that case, you can use Trickmans script.
Edit: Genesis, in that case, Flash sees your '0000' as a string. At least, I think.
no, i don't want a number that always has four digits. four digits was just an example, the more important was the fact that the number zero doesn't show...
...if i put "0000" with parenthesis, what happens when i tell +=1?
Look, text boxes can only hold text.
To put some text in the box, just do this:
myString = "345443";
To get it out to do somthing, do this:
myNumber = Number(myString);
myNumber += 5;
myNumber *= 5;
then myString = String(myNumber); (The String() function may not be needed here).
why do you want 0's to show anyways?
well, when we begin a game, the score is supposed to be at 0...