# replaceText

**URL:** <https://forum.kirupa.com/t/replacetext/212382>\
**Category:** flash\
**Created:** [January 10, 2007, 5:46pm UTC](https://forum.kirupa.com/t/replacetext/212382 "2007-01-10T17:46:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rutin](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@rutin](https://forum.kirupa.com/u/rutin)\
**Post date:** [January 10, 2007, 5:46pm UTC](https://forum.kirupa.com/t/replacetext/212382/1 "2007-01-10T17:46:26Z")

</div>

I have two text boxes,

1. Instance “myinput”
2. Instance “htmltext”

When user types something in “myinput” ( some basic text ) is automaticaly displayed in “htmltext”

```auto

function getIndexs() {
    if (Selection.getBeginIndex() != -1 && Selection.getEndIndex() != -1) {
        startIndex = Selection.getBeginIndex();
        endIndex = Selection.getEndIndex();
    }

    trace(_root.htmltext.text);
    _root.htmltext.text = myinput.htmlText;
}

```

I came a problem, i would like to replace “:(” with “sad.jpg”

Like str replace in php.  
i tried with replaceText but wont work

Can any1 help me with this ?  
Thank you,  
rutin
