  | |  | Where to put a function | Where to put a function 2004-02-06 - By Brook Davies
Back Hi! I got this search/replace function from actionscript.org. I'm not sure where I should put it? Should it go in the actual String.as file in the flash directory? or should I change it to be a _global function that is specific to my current project within my function_library.as file?
String.prototype.searchReplace=function(find,replace) {
return this.split( find ).join( replace); }
Brook
<html> <body> Hi! I got this search/replace function from actionscript.org. I'm not sure where I should put it? Should it go in the actual String.as file in the flash directory? or should I change it to be a _global function that is specific to my current project within my function_library.as file?<br><br> <br><br> <pre><font face="Courier New, Courier" color="#000087">String</font>.<font face ="Courier New, Courier" color="#000087">prototype</font>.searchReplace=<font face="Courier New, Courier" color="#000087">function</font>(find,replace) { <font face="Courier New, Courier" color="#000087">return this</font>.<font face="Courier New, Courier" color="#000087">split</font>( find ).<font face="Courier New, Courier" color="#000087">join</font>( replace); }
</pre><font face="Courier New, Courier">Brook</font> <br> </body> </html>
Earn $52 per hosting referral at Lunarpages.
|
|
 |