TextField类有个htmlText属性,能指定字体,大小,颜色之类的,你可以看看api文档,有很详细的说明。象下面这样写: myTextField.htmlText="测试"+"<font color='#ff0000'>88</font>"+"测试"; 完整的测试代码如下: package { import flash.display.MovieClip; import flash.text.TextField; public class Main extends MovieClip { private var myTextField:TextField; public function Main() { myTextField=new TextField(); addChild(myTextField); myTextField.htmlText="测试"+"<font color='#ff0000'>88</font>"+"测试"; // constructor code } } }
tends MovieClip {
最新推荐文章于 2024-11-09 18:19:47 发布