Posted By

imhugo on 01/16/08


actionscript replace text

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Replace Text

 / Published in: ActionScript

// "display_txt" is an instance name of an already created textfield // It's simply tracing the return value

  1. function replaceText( field:TextField, toSearch:String, toReplace:String)
  2. {
  3. return field.split(toSearch).join(toReplace);
  4. };
  6. trace(replaceText(display_txt.text, "a", "b"));

Report this snippet  


RSS Icon Subscribe to comments
Posted By: DaemonFuga on June 18, 2009

Tankyou for the code, is very usseful.

You need to login to post a comment.