repeat text animation, as3

Posted by pixelGreaser on Stack Overflow See other posts from Stack Overflow or by pixelGreaser
Published on 2010-05-11T17:04:43Z Indexed on 2010/05/11 17:54 UTC
Read the original article Hit count: 210

Filed under:
|

Hi,
My text animation works perfectly, but doesn't repeat. How do I get this to repeat? Sorry I don't know Flash that well, but I just want this to play over and over. Thanks.

var myArray:Array = ["Big",
                     "Holiday",
                     "Sale",
                     "Buy",
                     "Now",
                     "And",
                     "Save"];
Timer
var tm:Timer = new Timer(500,0);
tm.addEventListener(TimerEvent.TIMER, countdown);
function countdown(event:TimerEvent) {
if (myArray.length>0){
tx.text = myArray.shift();
}
}
tm.start();

I tried this

if (++myArray.length % 10 == 0)

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3