Profile
Achievement
adrianparr's Recent Snippets
- All /
To style the text in a TextArea component, create a TextFormat object and pass it to the TextArea's setStyle method.
0
2459
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
1971
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
2072
posted 16 years ago by adrianparr
This demo expects there to be 10 video UI components on the stage ('playPauseBtn', 'stopBtn', 'backBtn', 'forwardBtn', 'seekBar', 'captionBtn', 'fullScreenBtn', 'muteBtn', 'volumeBar' and 'bufferingBar') these can all be skinned as required. You also...
1
2902
posted 16 years ago by adrianparr
You need to create the 'SWFReader.as' class file (see link above) and save it in to the package (folder structure) 'com/senocular/utils'.
1
2078
posted 16 years ago by adrianparr
You need to download the SWC from here (http://github.com/claus/as3swf/archives/master) first.
0
1429
posted 16 years ago by adrianparr
This handy little function can be used to convert a displayObject to black and white.
0
2035
posted 16 years ago by adrianparr
I always forget which method does what. This is just as a quick reminder.
4
4411
posted 16 years ago by adrianparr
If the item cannot be found then the return value is NaN. This function only returns the index of the first occurence found, so it's not very good if you have multiple occurrences of the same value in the array.
0
3990
posted 16 years ago by adrianparr
In AS2 forward slashes got url-encoded to %2F when you escaped them. But in AS3 they get ignored and left as they are. In some situations I have found that this can cause problems. So you can do it manually using this regular expression.
0
2095
posted 16 years ago by adrianparr
I'm not sure whether I should be using == (Equality) or === (Strict equality) here. I haven't been able to create a situation where it makes much difference. If you know better, feel free to leave me a comment.
0
2293
posted 16 years ago by adrianparr