# Curious Problem with my Typewriter effect: HELP!

**URL:** <https://forum.kirupa.com/t/curious-problem-with-my-typewriter-effect-help/194289>\
**Category:** Uncategorized\
**Created:** [July 21, 2006, 9:32pm UTC](https://forum.kirupa.com/t/curious-problem-with-my-typewriter-effect-help/194289 "2006-07-21T21:32:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![5TEF](https://avatars.discourse-cdn.com/v4/letter/5/85e7bf/32.png) [@5TEF](https://forum.kirupa.com/u/5TEF)\
**Post date:** [July 21, 2006, 9:32pm UTC](https://forum.kirupa.com/t/curious-problem-with-my-typewriter-effect-help/194289/1 "2006-07-21T21:32:06Z")

</div>

Hi,

i’ve made a little XML news scroller ( 2 buttons : Up and Down )…with a typewriter effect.  
all work very fine, but when i click fast, and several times on my up (or down) button, the typewriter effect have problem and write lot of letters instead of my XML news…

what’s the problem ?

here my code of my “displayNews” function :

```auto

function displayNews() {
    modulNews.date.htmlText = tableDate[indexNews];
    modulNews.news.htmlText = tableNews[indexNews];
    laNews = modulNews.news.text;
    modulNews.news.text = "";
    var i = 0, taille = laNews.length, interval;
    updateRate = 30;
    DisplayChars = function () {
        modulNews.news.text += laNews.charAt(i);
        updateAfterEvent();
        if (i++ == taille) {
            clearInterval(interval);
        }
    };
    interval = setInterval(DisplayChars, updateRate);
}

```
