I have a page I'm putting together that has a stf embedded in it. http://jimslounge.com/segovia/
I almost have it working the way I want. I have the stf code wrapped in a timer and things don't sync quite right.
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.text.*;
import com.greensock.text.SplitTextField;
var segovia_stf:SplitTextField;
var myTextLoader:URLLoader = new URLLoader();
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
var myTimer:Timer = new Timer(9000);
myTimer.addEventListener(TimerEvent.TIMER, timerListener);
function timerListener (e:TimerEvent):void{
runText();
}
myTimer.start();
function onLoaded(e:Event):void {
segovia_mc.segovia_txt.text = e.target.data;
segovia_stf = new SplitTextField(segovia_mc.segovia_txt);
}
function runText():void{
segovia_mc.y -=110;
if(segovia_mc.y < -330){segovia_mc.y=0;}
for (var i:int = segovia_stf.textFields.length - 1; i > -1; i--) {
TweenMax.to(segovia_stf.textFields[i], 1, {blurFilter:{blurX:10, blurY:10},
x:Math.random() * 650 - 100, y:Math.random() * 350 - 100,
scaleX:Math.random() * 4 - 2, scaleY:Math.random() * 4 - 2,
rotation:Math.random() * 360 - 180, autoAlpha:0,
delay:Math.random() * 0.4, ease:Quad.easeIn, repeat:1, yoyo:true, repeatDelay:0.2});
}
}
myTextLoader.load(new URLRequest("myText.txt"));
Any suggestions will be greatly appreciated.