Question : looping a script? AS3 Flash, Actionscript 3

Hi,

I have a small piece of script to fade some text in and out using tweener, all the animation happens on one frame.

I dont have any stops but once the script is finished nothing happens so i would like to automatically go back to the beginning of the script to restart...

does anyone know the as3 code for that?

thanks very much!

Answer : looping a script? AS3 Flash, Actionscript 3

please give this a try.. i am not at my work station to test it first

please let me know

GE

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
import caurina.transitions.*
var timer:Timer = new Timer(48000);
timer.addEventListener(TimerEvent.TIMER, notifier);
text1.alpha = 0;
text2.alpha = 0;
text3.alpha = 0;
 
 
 
function notifier(event:TimerEvent):void {
 text1.alpha = 0;
text2.alpha = 0;
text3.alpha = 0;
 
Tweener.addTween(text1, {alpha:1, time:2});
Tweener.addTween(text1, {alpha:0, time:2, delay:14});
 
Tweener.addTween(text2, {alpha:1, time:2, delay:16});
Tweener.addTween(text2, {alpha:0, time:2, delay:28});
 
Tweener.addTween(text3, {alpha:1, time:2, delay:30});
Tweener.addTween(text3, {alpha:0, time:2, delay:42});
}
 
 
Tweener.addTween(text1, {alpha:1, time:2});
Tweener.addTween(text1, {alpha:0, time:2, delay:14});
 
Tweener.addTween(text2, {alpha:1, time:2, delay:16});
Tweener.addTween(text2, {alpha:0, time:2, delay:28});
 
Tweener.addTween(text3, {alpha:1, time:2, delay:30});
Tweener.addTween(text3, {alpha:0, time:2, delay:42});
 
timer.start();
Open in New Window Select All
Random Solutions  
 
programming4us programming4us