| Pakket | flashx.textLayout.formats |
| Klasse | public final class TextAlign |
| Overerving | TextAlign Object |
| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
textAlign en textAlignLast van de klasse TextLayoutFormat. De waarden geven aan hoe de regeluitlijning in de alinea zich in relatief opzicht verhoudt met de container.
Verwante API-elementen
| Constante | Gedefinieerd door | ||
|---|---|---|---|
| CENTER : String = "center" [statisch] Geeft een gecentreerde uitlijning met de container aan. | TextAlign | ||
| END : String = "end" [statisch] Geeft aan de tekst wordt uitgelijnd met de eindrand: de tekst wordt tegengesteld aan de schrijfvolgorde uitgelijnd. | TextAlign | ||
| JUSTIFY : String = "justify" [statisch] Geeft aan dat tekst wordt uitgevuld binnen de regels, zodat de containerruimte wordt opgevuld. | TextAlign | ||
| LEFT : String = "left" [statisch] Geeft uitlijning met de linkerrand aan. | TextAlign | ||
| RIGHT : String = "right" [statisch] Geeft uitlijning met de rechterrand aan. | TextAlign | ||
| START : String = "start" [statisch] Geeft aan de tekst wordt uitgelijnd met de beginrand: de tekst wordt overeenkomstig aan de schrijfvolgorde uitgelijnd. | TextAlign | ||
CENTER | Constante |
public static const CENTER:String = "center"| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
Geeft een gecentreerde uitlijning met de container aan.
END | Constante |
public static const END:String = "end"| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
Geeft aan de tekst wordt uitgelijnd met de eindrand: de tekst wordt tegengesteld aan de schrijfvolgorde uitgelijnd. Equivalent aan rechts bij tekst van links naar rechts, of aan links bij tekst van rechts naar links.
JUSTIFY | Constante |
public static const JUSTIFY:String = "justify"| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
Geeft aan dat tekst wordt uitgevuld binnen de regels, zodat de containerruimte wordt opgevuld.
LEFT | Constante |
public static const LEFT:String = "left"| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
Geeft uitlijning met de linkerrand aan.
RIGHT | Constante |
public static const RIGHT:String = "right"| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
Geeft uitlijning met de rechterrand aan.
START | Constante |
public static const START:String = "start"| Taalversie: | ActionScript 3.0 |
| Runtimeversies: | Flash Player 10, AIR 1.5 |
Geeft aan de tekst wordt uitgelijnd met de beginrand: de tekst wordt overeenkomstig aan de schrijfvolgorde uitgelijnd. Equivalent aan links bij tekst van links naar rechts, of aan rechts bij tekst van rechts naar links.
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();
}
}
}
Wed Jun 13 2018, 11:42 AM Z
Overerfde openbare eigenschappen verbergen
Overerfde openbare eigenschappen weergeven