/ Published in: ActionScript

// "display_txt" is an instance name of an already created textfield // It's simply tracing the return value
Expand |
Embed | Plain Text
function replaceText( field:TextField, toSearch:String, toReplace:String) { return field.split(toSearch).join(toReplace); }; trace(replaceText(display_txt.text, "a", "b"));
Comments

You need to login to post a comment.
Tankyou for the code, is very usseful.
BlueRaven.com.mx