Timer Method and if statements?
I am interested in have a dynamic text field display three quotes at different intervals.
I thought I could use the Timer to trigger these quotes by loading them into the dynamic TextField.
However, I cannot seem to get it going.
I try to attach a number from the timer but that throws an error /1176: Comparison between a value with static type flash.utils:Timer and a possibly unrelated type int.�
First is this a good way to approach it?
If so this is my current code:
import flash.utils.Timer;
import flash.events.TimerEvent;
var timer:Timer=new Timer(1000,0);
timer.addEventListener(TimerEvent.TIMER, goQuotes);
timer.start();
function goQuotes(e:TimerEvent):void {
var reqA:URLRequest=new URLRequest("suzukiRules/ruleA.txt");
var loaderA:URLLoader = new URLLoader();
loaderA.addEventListener(Event.COMPLETE, textLoadedB);
loaderA.load(reqA);
function textLoadedB(event:Event):void {
ruleLoaderA.text=loaderA.data; if (timer>1000) { var reqB:URLRequest=new URLRequest("suzukiRules/ruleB.txt"); var loaderB:URLLoader = new URLLoader(); loaderB.addEventListener(Event.COMPLETE, textLoadedC); loaderB.load(reqB);function textLoadedC(event:Event):void {
ruleLoaderA.text=loaderB.data;
//if(timer>1000){
}
} }
}