Search code examples
flashactionscript-3marquee

how to change the Size and color of Marquee text field in ActionScrtipt3?


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


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);