Leading Zero on Single Digits (Flash)
actionscript-3, flash
Solution
function leadingZero(num : Number) : String {
if(num < 10) {
return "0" + num;
}
return num.toString();
}
Problem
I am using Flash CS3 - AS 3.0. I have the following code that I am using to make the image count external: I am not sure if you all are familiar with Slideshow pro (I dont think that you need to in order to help me). ``` function albumStuff(event:SSPDataEvent) { if (event.type=="albumData") { total1.text = event.data.totalImages; } } ``` How would I make a leading zero come up infront of the number that comes up in that text field as long as it's 9 and under? I hope my question isn't confusing.