Substring + htmlText = DISASTER! *help please*

Hi guys, what I have is a simple typrewriter effect using substring to reveal content. When new content is loaded in, I want that to replace the current text without clearing the text field. That’s easy enough.

The problem is that I’m using htmlText, so when the new content replaces the old, one character at a time, the html tags no longer get read as html . . . any way to fix this? Here is the AS, and and example:

function TextTyper(targetField, targetData, targetFormat) {
        var thisObj = this;
        thisObj.charNum = 0;
        thisObj.typerField = targetField;
        thisObj.typerData = targetData;
        thisObj.curData = targetField.entry.htmlText;
        thisObj.dataLength = thisObj.typerData.length;
        thisObj.typerDur = 20;
        thisObj.typerFormat = targetFormat;
        thisObj.typerInt=setInterval(thisObj, "executeCallback", thisObj.typerDur);
    }
    private function executeCallback() {
        var thisObj = this;
        if (thisObj.charNum<thisObj.typerData.length) {
            thisObj.typerField.entry.htmlText = thisObj.typerData.substring(0, thisObj.charNum)+thisObj.curData.substring(thisObj.charNum);
            thisObj.charNum += thisObj.dataLength/thisObj.typerDur;
            thisObj.typerField.entry.setTextFormat(thisObj.typerFormat);
        } else {
            thisObj.typerField.entry.htmlText = thisObj.typerData;
            thisObj.typerField.entry.setTextFormat(thisObj.typerFormat);
            clearInterval(thisObj.typerInt);
        }
    }

It all works fine but when you have something like:
“<a href=“blah.html”>Click here!</a>” when it gets replaced with “New Content” it becomes:
“Na href . . .>”, then “Ne href . . .>”, and so on, meaning Flash no longer recognizes the HTML with the ‘<’ (obviously).

Does anyone have any great ideas?

Thanks in advance!:beam: