str_replace() function
May 22nd, 2009 |
ActionScript 3.0 Snippets |
Cam |
No comments
function str_replace(search, replace, string) { while(string.indexOf(search) != -1) { var array = string.split(search); string = array.join(replace); } return string; } // Example var str = 'testing\r\nthis'; trace(str); var newString = str; newString = str_replace("\r", '', newString); newString = str_replace("\n", ' ', newString); trace(newString);
randRange Function
March 28th, 2009 |
ActionScript 3.0 Snippets |
Cam |
No comments
I find myself needing a random number between 2 numbers often. So I wrote this awhile ago and then go trotting back through code to find it. I thought it would be better if I just posted it here for quicker access
Read More...loadXML() Function
February 2nd, 2009 |
ActionScript 3.0 Snippets |
Cam |
No comments
This function takes an xml file and creates an object of its contents making it accessible after loading
Read More...