適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
flashx.textLayout.formats 

TextAlign  - AS3

套件flashx.textLayout.formats
類別public final class TextAlign
繼承TextAlign Inheritance Object

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

定義設定 TextLayoutFormat 類別之 textAligntextAlignLast 屬性的值。這些值描述段落中字行相對於容器的對齊。

檢視範例

相關 API 元素



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
公用方法
 方法定義自
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
公用常數
 常數定義自
  CENTER : String = "center"
[靜態] 指定容器內的置中對齊。
TextAlign
  END : String = "end"
[靜態] 指定結尾邊緣對齊 - 文字的對齊方向與寫入方向相反。
TextAlign
  JUSTIFY : String = "justify"
[靜態] 指定文字在字行中為左右對齊,以填滿容器空間。
TextAlign
  LEFT : String = "left"
[靜態] 指定對齊左邊緣。
TextAlign
  RIGHT : String = "right"
[靜態] 指定對齊右邊緣。
TextAlign
  START : String = "start"
[靜態] 指定開頭邊緣對齊 - 文字對齊方向與寫入方向一致。
TextAlign
常數詳細資訊

CENTER

常數
public static const CENTER:String = "center"

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

指定容器內的置中對齊。

END

常數 
public static const END:String = "end"

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

指定結尾邊緣對齊 - 文字的對齊方向與寫入方向相反。等同於指定由左向右文字的靠右對齊,或由右向左文字的靠左對齊。

JUSTIFY

常數 
public static const JUSTIFY:String = "justify"

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

指定文字在字行中為左右對齊,以填滿容器空間。

LEFT

常數 
public static const LEFT:String = "left"

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

指定對齊左邊緣。

RIGHT

常數 
public static const RIGHT:String = "right"

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

指定對齊右邊緣。

START

常數 
public static const START:String = "start"

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

指定開頭邊緣對齊 - 文字對齊方向與寫入方向一致。等同於設定由左向右文字的靠左對齊,或由右向左文字的靠右對齊。

TextAlignExample.as

這個範例會使用 CENTER、JUSTIFY 和 RIGHT 對齊方式,對齊 "Hello World" 的三個段落。
package flashx.textLayout.formats.examples {
    import flash.display.Sprite;
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.elements.ParagraphElement;
    import flashx.textLayout.elements.SpanElement;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.TextAlign;
    import flashx.textLayout.formats.TextJustify;

    public class TextAlignExample extends Sprite
    {
        public function TextAlignExample()
        {
            var textFlow:TextFlow = new TextFlow();
            //create paragraphs and corresponding spans
            var pCenter:ParagraphElement = new ParagraphElement();
            var pJustify:ParagraphElement = new ParagraphElement();
            var pRight:ParagraphElement = new ParagraphElement();    
            var spanCenter:SpanElement = new SpanElement();
            var spanJustify:SpanElement = new SpanElement();
            var spanRight:SpanElement = new SpanElement();
            // add text to the spans
            spanCenter.text = "Hello, World\n";
            spanJustify.text = "Hello, World\n";
            spanRight.text = "Hello, World";
            // add spans to paragraphs and specify alignment
            pCenter.addChild(spanCenter);
            pCenter.textAlign = TextAlign.CENTER;
            
            pJustify.addChild(spanJustify);
            pJustify.textAlign = TextAlign.JUSTIFY;
            pJustify.textJustify = TextJustify.DISTRIBUTE;
                    
            pRight.addChild(spanRight);
            pRight.textAlign = TextAlign.RIGHT;
            // add paragraphs to TextFlow
            textFlow.addChild(pCenter);
            textFlow.addChild(pJustify);
            textFlow.addChild(pRight);
            // update controller to display
            textFlow.flowComposer.addController(new ContainerController(this,80,800));
            textFlow.flowComposer.updateAllControllers();
        }
    }
}




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。