亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Flex中實(shí)現(xiàn)對(duì)一個(gè)text渲染不同的字體顏色示例

 更新時(shí)間:2013年07月09日 17:28:25   作者:  
本文為大家詳細(xì)介紹下Flex中如何實(shí)現(xiàn)對(duì)一個(gè)text渲染不同的字體顏色,具體的實(shí)現(xiàn)思路及代碼如下,有興趣的朋友可以參考下哈,希望對(duì)大家有所幫助
開(kāi)始把控件局限在label上,發(fā)現(xiàn)實(shí)現(xiàn)起來(lái)似乎不太現(xiàn)實(shí)。應(yīng)該用textarea控件:
復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="inital();">
<fx:Script>
<![CDATA[
import flashx.textLayout.conversion.TextConverter;
public function inital():void{
var str:String = "<font color='#ff0000'>123456<font color='#32CD32'>shit</font></font>";
txt.textFlow = TextConverter.importToFlow(str, TextConverter.TEXT_FIELD_HTML_FORMAT);
//txtArea.text = "我是中國(guó)人我是中國(guó)人我是中國(guó)人我是中國(guó)人";
}
]]>
</fx:Script>
<mx:Canvas x="300" y="300" width="500" height="500">
<s:TextArea id="txt">
</s:TextArea>
</mx:Canvas>
</s:Application>

相關(guān)文章

最新評(píng)論