Posted By

drukepple on 07/04/06


actionscript String utilitiy

Versions (?)

Who likes this?

4 people have marked this snippet as a favorite


String Search and Replace

 / Published in: ActionScript

Provides a quick and simple "find this string pattern and replace it with this other string pattern" find and replace. Not fancy enough for regular expressions, but untill AS3 is standard this works well for most search/replace needs.

Can be very handy for processing incoming text, whether via user input or from a database or otherwise. For instance, searching for "\r" and replacing with "\n" or "" to control how line breaks flow.

  1. myString.split("foo").join("bar");

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Roshambo on July 26, 2006

If I'm correct, this works in JavaScript too.

Posted By: pordux on September 6, 2007

hei,, i dont know if you have the time to answer me this questions, but i'm a little bit deseperated....

i have this script:

var arreglo3:String =_root.btn3admintitle;

var arreglo4:String =_root.btn4minsidetitle;

var arreglo5:String =_root.btn5systemtitle;

if(arreglo3 == "falso"){ root.btn3.titu.text = arreglo3; } else{ _root.mainMenu.peliMovie.attachMovie("btn3admin", "btn3adminvideo", this.getNextHighestDepth(), {x:5, _y:18}); }

if(arreglo4 == "falso"){ this.btn4.titu.text = arreglo4; } else{ this.mainMenu.peliMovie.attachMovie("btn4minside", "btn4minsidevideo", this.getNextHighestDepth(), {_x:5, _y:54}); }

if(arreglo5 == "falso"){ this.btn5.titu.text = arreglo5; } else{ this.mainMenu.peliMovie.attachMovie("btn5system", "btn5systemvideo", this.getNextHighestDepth(), {_x:5, _y:92}); }

what i want to do is to evaluate several times different variables, wheter if they are = to "falso" or to ather string,

The problem is that when the script runs it only read the last script... the last "if"... how can i make it to read all the 3 "if's"...?? or more?....



You need to login to post a comment.