首页» FLEX »FLEX例子之标记(Label)

FLEX例子之标记(Label)

立即注册PayPal并开始接受信用卡付款。
转载请保持文章完整性!
本文链接地址:http://blog.desizen.com/4lone/288.html
主页:joel's blog

这个例子进行的是UI Controls:Data Entry Controls:
终于到了我们用了很多次的组件了,这个实际上就是为了显示文字而设计的,下面的是例子的说明:
The control displays a single line of noneditable text. Use the Text control to create blocks of multiline noneditable text.
例子:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundGradientColors="[0x000000,0x323232]" viewSourceURL="srcview/index.html">
<!-- Simple example to demonstrate the Label control -->
<!--这个例子非常的简单,唯一用到的新知识就是htmlData-->
    <mx:Script>
        <![CDATA[
 
            private var htmlData:String="<br>This label displays <b>bold</b> and <i>italic</i> HTML-formatted text.";
 
            // Event handler function to change the image size.
            private function displayHTML():void {
                simpleLabel.htmlText= htmlData;
            }
 
            // Event handler function to change the image size.
            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>

标签:, , ,

与"FLEX例子之标记(Label)"相关的文章:

评论暂缺 »

还没有任何评论。

留下评论

emoticons

Feedback Form