2009-11-03 100 views

回答

0

我收到的Flashcoders邮件列表的解决方案昨天,它真的HIST现货:

我适应的例子以下 页面上向您展示一个快速测试:

[http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f4a.html][1]

我改变了drawLayout功能 突出词“渲染”红色。 您还需要导入TextFormat和 TextField类。

override protected function drawLayout():void { 
    textField.width = this.width; 
    var text:String = textField.text; 
    var tf:TextFormat = textField.getTextFormat(); 
    var redIdx:int = text.indexOf("renderer"); 
    if (-1 != redIdx) { 
    tf.color = 0xff0000; 
    } 
    TextField(textField).setTextFormat(tf, 

redIdx,(redIdx + 8)); super.drawLayout(); }

[1]: http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f4a.html