Flex中嵌入Html代码范例
来源:互联网 发布:图书馆数据库是什么 编辑:程序博客网 时间:2024/05/19 13:27
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ public var htmltext:String = "This <u>is</u> a <br> <font color=\"#0000ee\" >HTML-formatted</font> text." ]]> </mx:Script> <mx:Panel title="Label Example" height="600" width="800" paddingTop="10" paddingLeft="10"> <mx:VBox borderStyle="inset"> <mx:Label id="simpleLabel" text="Label text." fontSize="12" width="400" enabled="true"/> <mx:Label id="htmlTextLabel" htmlText="{htmltext}"> </mx:Label> </mx:VBox> <mx:VBox borderStyle="inset" visible="true"> <mx:Text width="100%"> <mx:text> This is a multiline, non-editable text component. </mx:text> </mx:Text> <mx:Text width="100%"> <mx:htmlText> <![CDATA[This is <br><font color="#FF0000">HTML text</font> in a <b>Text component</b>.]]> </mx:htmlText> </mx:Text> </mx:VBox> <mx:VBox borderStyle="inset" visible="true"> <mx:TextInput id="textinput" text="Hello World!" displayAsPassword="true"/> </mx:VBox> <mx:VBox borderStyle="inset" visible="true"> <mx:TextArea width="500" height="50"> <mx:htmlText> <![CDATA[ This is a TextArea.<br><font color="#FF0000">HTML text</font> ]]> </mx:htmlText> </mx:TextArea> </mx:VBox> <mx:VBox borderStyle="inset" visible="true"> <mx:RichTextEditor id="rte" title="RichTextEditor" width="500" height="200" text="RichTextEditor display your text as plain text, or as HTML-formatted text."/> </mx:VBox> </mx:Panel> </mx:Application>
http://www.bxyst.com