| Paquete | flashx.textLayout.formats |
| Clase | public final class TextAlign |
| Herencia | TextAlign Object |
| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
textAlign y textAlignLast de la clase TextLayoutFormat. Los valores describen la alineación de líneas en el párrafo con respecto al contenedor.
Elementos de API relacionados
| Constante | Definido por | ||
|---|---|---|---|
| CENTER : String = "center" [estática] Especifica la alineación central en el contenedor. | TextAlign | ||
| END : String = "end" [estática] Especifica la alineación final en el borde: el texto se alinea al contrario del orden de escritura. | TextAlign | ||
| JUSTIFY : String = "justify" [estática] Especifica que el texto está justificado dentro de las líneas para que llene todo el espacio del contenedor. | TextAlign | ||
| LEFT : String = "left" [estática] Especifica la alineación al borde izquierdo. | TextAlign | ||
| RIGHT : String = "right" [estática] Especifica la alineación al borde derecho. | TextAlign | ||
| START : String = "start" [estática] Especifica la alineación inicial en el borde: el texto se alinea según el orden de escritura. | TextAlign | ||
CENTER | Constante |
public static const CENTER:String = "center"| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Especifica la alineación central en el contenedor.
END | Constante |
public static const END:String = "end"| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Especifica la alineación final en el borde: el texto se alinea al contrario del orden de escritura. Equivale a especificar la alineación a la derecha en textos de izquierda a derecha o a la izquierda en textos de derecha a izquierda.
JUSTIFY | Constante |
public static const JUSTIFY:String = "justify"| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Especifica que el texto está justificado dentro de las líneas para que llene todo el espacio del contenedor.
LEFT | Constante |
public static const LEFT:String = "left"| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Especifica la alineación al borde izquierdo.
RIGHT | Constante |
public static const RIGHT:String = "right"| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Especifica la alineación al borde derecho.
START | Constante |
public static const START:String = "start"| Versión del lenguaje: | ActionScript 3.0 |
| Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Especifica la alineación inicial en el borde: el texto se alinea según el orden de escritura. Equivale a establecer la alineación a la izquierda en textos de izquierda a derecha o a la derecha en textos de derecha a izquierda.
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();
}
}
}
Tue Jun 12 2018, 02:12 PM Z
Ocultar propiedades públicas heredadas
Mostrar propiedades públicas heredadas