Question

I have a class for MarqueetextField, I am trying to change the text inside a marquee tag and the color of the marquee using as3.I Don't Know how to Change the Color and Size,kindly anybody Help me

Was it helpful?

Solution

RC told you to do something like this.

var tf:TextField = new TextField();
tf.text = "Super Long Message Goes Here ";
tf.textColor = 0xFF0000; // <----------------------------------
tf.x = tf.y = 300;
addChild(tf);
var t:Timer = new Timer(200);
t.addEventListener(
    TimerEvent.TIMER,
    function(ev:TimerEvent): void
    {
        tf.text = tf.text.substr(1) + tf.text.charAt(0);
    }
);
t.start();

or this:

var tf:MarqueeTextField = new MarqueeTextField();
tf.text = "Super Long Message Goes Here ";
tf.textColor = 0xFF0000; // <------------------------
tf.x = tf.y = 300;
tf.marquee(200);
addChild(tf);

OTHER TIPS

Since it extends the Textfield class, you should be able to change the properties like textColor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top