![flash actionscript 3.0 number to string flash actionscript 3.0 number to string](http://www.webmastersbydesign.com/wp-content/uploads/2008/09/actionscriptcheatsheetscreenshot.jpg)
Return padValue(elem + padChar, padChar, finalLength, dir) Return padValue(padChar + elem, padChar, finalLength, dir) make sure the direction is in lowercase
![flash actionscript 3.0 number to string flash actionscript 3.0 number to string](http://i.stack.imgur.com/k8hrE.png)
* This function will pad the left or right side of any variable passed inįunction padValue(elem, padChar, finalLength, dir) It allows you to pass in a value and pad either the left or right side up to a given amount of characters. I couldn't find anything built into AS2 or AS3 to do this so I wrote something that would. Making sure it displays a "05" instead of "5".
![flash actionscript 3.0 number to string flash actionscript 3.0 number to string](https://i.ytimg.com/vi/JGRYeSU6TG8/maxresdefault.jpg)
For example making sure a month always has two digits. I was working on a date/time format in Flash and needed a way to pad values out so they always took up the same amount of space.