Array, change color, as3
- by pixelGreaser
Hi
Thanks for the help Yesterday, but I have on more question. How can I change color of text on certain words?
My animation plays the text animation of THIS SALE IS RED HOT!!! I want RED HOT it to be red. It seems the array can be indexed in such a way to switch the color from Blue to Red.
MY BANNER ADD
var myArray:Array = ["THIS","SALE","IS","RED HOT!!!",];
var tm:Timer = new Timer(500);
tm.addEventListener(TimerEvent.TIMER, countdown);
function countdown(event:TimerEvent) {
tx.text = myArray[(tm.currentCount-1)%myArray.length];
}
tm.start();
tx.textColor = 0x0000FF;
Cont...PSEUDO CODE
//var myArray:Array = ["This","Sale","is","RED HOT!!!",];
var spliceRedhot = myArray.splice(-1);
//trace(myArray[2]);
trace(spliceRedhot);
function mySplice(e:Event):void{
if (spliceRedhot = 4){
//Make RED HOT!!! red
tx.textColor = 0xFF0000;
}
else{
//Text is Blue again
tx.textColor = 0x0000FF;
}
}