Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Where to put a function

Where to put a function

2004-02-06       - By Brook Davies

 Back
Reply:     1     2     3     4     5     6  

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)
{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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.