<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundGradientColors="[0x000000,0x323232]" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
private var htmlData:String="<br>This label displays <b>bold</b> and <i>italic</i> HTML-formatted text.";
private function displayHTML():void {
simpleLabel.htmlText= htmlData;
}
private function displayText():void {
simpleLabel.text="This Label displays plain text.";
}
]]>
</mx:Script>
<mx:Panel title="Label Control Example" height="75%" width="75%"
paddingTop="10" paddingLeft="10" color="0xffffff" borderAlpha="0.15">
<mx:Label id="simpleLabel" text="This Label displays plain text." color="0x000000"/>
<mx:Button id="Display" label="Click to display HTML Text" click="displayHTML();" color="0x000000"/>
<mx:Button id="Clear" label="Click to display plain text" click="displayText();" color="0x000000"/>
</mx:Panel>
</mx:Application>
No comments:
Post a Comment