简体   繁体   中英

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

我有一个MarqueetextField的类,我试图改变一个marquee标签内的文字和使用as3的字幕的颜色。我不知道如何改变颜色和大小,请帮助我

由于它扩展了Textfield类,您应该能够更改textColor等属性。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM