Profile

Achievement

first submission:submitting first snipplet

adrianparr's Recent SnippetsTagged format



« Prev 1 Next »
I was working on a project where the timestamp string I was getting from the backend developer was pretty dirty in the way it was formatted. For example, it looked like "/Date(1310127448000+0100)/". I needed to get a nicely formatted time from it in...
0 2396 posted 15 years ago by adrianparr
For this to work you need the as3corelib classes from here ... https://github.com/mikechambers/as3corelib
0 5510 posted 15 years ago by adrianparr
This example expects there to be a dynamic textfield on the stage with the instance name of 'myTextFieldOnStage'. Remember to embed the fonts (Numerals and Colon).
0 2670 posted 15 years ago by adrianparr
To style the text in a TextArea component, create a TextFormat object and pass it to the TextArea's setStyle method.
0 2464 posted 16 years ago by adrianparr
This code removes all the spaces and then inserts a single space so that the there are only 3 characters on the right-hand side (the inward code).
0 1975 posted 16 years ago by adrianparr
This returns a string with a single space after the fifth character. Useful for displaying a UK mobile number which is easy to read.
0 2075 posted 16 years ago by adrianparr
Format a number so it is more humanly readable. It allows for setting the number of decimal places (inc. adding 0000s to the end) and separating thousands with a comma. Example usage: trace(numberFormat(1234.695, 2, true, false)); // Output:...
0 2844 posted 16 years ago by adrianparr
« Prev 1 Next »