メソッド | プロパティ | エフェクト | イベント | スタイル | フレームあり | フレームなし

mx.controls
Text クラス

継承を示す線継承を示す線


Text クラス
mx.controls.Label の拡張

Text コントロールは複数行の編集不可能なテキストを表示します。Text コントロールはスクロールバーをサポートしません。このコントロールの推奨サイズは、指定したテキストを表示するのに十分な大きさです。

Text コントロールでは、HTML テキストと、さまざまなテキストおよびフォントスタイルをサポートしています。テキストは必ずコントロールの境界で折り返され、コントロールの上端に揃えられます。Text コントロールは透明なので、コンポーネントのコンテナの背景が透けて表示されます。また、コントロールの境界線はありません。

MXML シンタックス

<mx:Text> タグは、親クラスのすべてのプロパティを継承し、次のプロパティを定義します。

 <mx:Text
marginTop="0"
marginBottom="0"
selectable="true|false"
/>

を参照するにはここをクリックしてください

関連項目
    Label
    TextInput
    TextArea



メソッド

mx.core.UIObject クラスから継承されるメソッド
addEventListener   applyProperties   buildDepthTable   commitProperties   constructObject2   createAccessibilityImplementation   createChildAtDepth   createChildren   createClassChildAtDepth   createClassObject   createEmptyObject   destroyObject   dispatchEvent   doLater   draw   drawRect   executeBindings   fillRect   findNextAvailableDepth   getRepeaterItem   getStyle   handleEvent   init   invalidate   invalidateLayout   invalidateProperties   invalidateSize   invalidateStyle   layoutChildren   measure   move   redraw   removeEventListener   setDepthAbove   setDepthBelow   setMask   setSize   setSizeNoLayout   setStyle   swapDepths  



プロパティ
       className:String
このクラスの名前です。
       selectable:Boolean
テキストの選択を許可する場合は true、許可しない場合は false を指定します。
staticversion:String
このクラスのバージョンを表すストリングです。

mx.controls.Label クラスから継承されるプロパティ
className   htmlText   text   version  

mx.core.UIObject クラスから継承されるプロパティ
alpha   baselinePosition   className   depth   documentDescriptor   height   heightFlex   id   instanceIndices   isDocument   kStretch   layoutHeight   layoutWidth   maxHeight   maxWidth   minHeight   minWidth   mouseX   mouseY   nestLevel   oldHeight   oldWidth   oldX   oldY   parent   parentApplication   parentDocument   percentHeight   percentWidth   preferredHeight   preferredWidth   repeaterIndices   scaleX   scaleY   styleName   tabEnabled   toolTip   version   visible   width   widthFlex   x   y  



エフェクト

mx.core.UIObject クラスから継承されるエフェクト
creationCompleteEffect   hideEffect   mouseDownEffect   mouseOutEffect   mouseOverEffect   mouseUpEffect   moveEffect   resizeEffect   showEffect  



イベント

mx.controls.Label クラスから継承されるイベント
hide  show 

mx.core.UIObject クラスから継承されるイベント
creationComplete  dragComplete  dragDrop  dragEnter  dragExit  dragOver  draw  effectEnd  effectStart  hide  hideToolTip  initialize  load  mouseChangeSomewhere  mouseDown  mouseDownSomewhere  mouseMove  mouseMoveSomewhere  mouseOut  mouseOver  mouseUp  mouseUpSomewhere  move  resize  show  showToolTip  unload 



スタイル
marginBottom型 : Number   形式 : Length   CSS の継承 : なし
コントロールの下の境界とコンテンツ領域との間のピクセル数です。デフォルト値は 0 です。
marginTop型 : Number   形式 : Length   CSS の継承 : なし
コントロールの上の境界とコンテンツ領域との間のピクセル数です。デフォルト値は 0 です。

mx.controls.Label クラスから継承されるスタイル
disabledColor  

mx.core.UIObject クラスから継承されるスタイル
color   fontFamily   fontSize   fontStyle   fontWeight   horizontalGap   leading   marginLeft   marginRight   textAlign   textDecoration   textIndent   verticalGap  



プロパティの詳細

className

className:String  

このクラスの名前です。


selectable

selectable:Boolean  

テキストの選択を許可する場合は true、許可しない場合は false を指定します。テキストを選択可能にすると、テキストをコピーおよびペーストできます。デフォルト値は true です。


version

static  version:String  

このクラスのバージョンを表すストリングです。


TextExample.mxml
<?xml version="1.0"?>
<!-- Text コントロールの使用方法を示す簡単な例 -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF">

<mx:Script>
<![CDATA[
var sampleText= "The Text control displays multiline, noneditable text." + 
"The Text control does not support scroll bars; its preferred size is a square large enough to display " + 
"the specified text. " + 
" The Text control supports HTML text and a variety of text and font styles. " + 
"The text always wraps at the control boundaries, and is always aligned at the top of the control." + 
"The Text control is transparent so that the background of the component's container shows through," + 
"and the control has no borders." ;

       
function showOutput()
           {
textoutput.text= "Text Format:" + sampleText;             
           }
           
function clearText()
           {
textoutput.text="";
           }       
         ]]>
</mx:Script>

<mx:Panel title="Text Panel" marginTop="10">

<mx:Text  id="textoutput" text="Text control output will be displayed here." width="295" height="135"
color="#0000FF"/>
        
<mx:HBox>
<mx:Button label="Press Enter"  click="showOutput();"/>
<mx:Button label="Clear"  click="clearText();"/>
</mx:HBox>       
    
</mx:Panel>

</mx:Application>