Stuck with timing on AS code

Hi,
I’m working on this script:

I have adapted it so that users can enter their own text and it will be rendered as smoke text…

The problem I have is that if the user enters text which is too long, e.g.

Happy Birthday John

Then the timing of the script is such that before it gets to the end, it restarts again, so the full message is not displayed.

I have been looking at the AS code but I can’t work out what in the code controls when it resets and starts again.

I’m running the code in FlashDevelop in case that is relevant.

Any advice would be much appreciated.

Thank you!