| Package | flashx.textLayout.elements |
| Class | public class FlowElement |
| Inheritance | FlowElement Object |
| Subclasses | FlowGroupElement, FlowLeafElement |
| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
The root of a composable FlowElement tree is always a TextFlow object. Leaf elements of the tree are always subclasses of the FlowLeafElement class. All leaves arranged in a composable TextFlow have a ParagraphElement ancestor.
You cannot create a FlowElement object directly. Invoking
new FlowElement()
throws an error
exception.
See also
| Property | Defined By | ||
|---|---|---|---|
| alignmentBaseline : String [write-only] CharacterFormat:
Specifies the line baseline to which the element baseline specified by the elementBaseline property should align to determine the vertical position of the element on the line. | FlowElement | ||
| baselineShift : Object [write-only] CharacterFormat:
Amount to shift the baseline from the elementBaseline. | FlowElement | ||
| breakOpportunity : String [write-only] CharacterFormat:
Controls where lines are allowed to break when wrapping text is broken into multiple lines. | FlowElement | ||
| cffHinting : String [write-only] CharacterFormat:
The type of CFF hinting used for this text. | FlowElement | ||
| characterFormat : ICharacterFormat CharacterFormat properties applied directly to this element. | FlowElement | ||
| color : Object [write-only] CharacterFormat:
Color of the text. | FlowElement | ||
![]() | constructor : Object A reference to the class object or constructor function for a given object instance. | Object | |
| digitCase : String [write-only] CharacterFormat:
The type of digit case used for this text. | FlowElement | ||
| digitWidth : String [write-only] CharacterFormat:
Type of digit width used for this text. | FlowElement | ||
| dominantBaseline : String [write-only] CharacterFormat:
Specifies which of the baselines of the element snaps to the alignmentBaseline to determine the vertical position of the element on the line. | FlowElement | ||
| fontFamily : String [write-only] CharacterFormat:
The name of the font to use, or a comma-separated list of font names. | FlowElement | ||
| fontLookup : String [write-only] CharacterFormat:
Font lookup to use. | FlowElement | ||
| fontSize : Object [write-only] CharacterFormat:
The size of the text in pixels. | FlowElement | ||
| fontStyle : String [write-only] CharacterFormat:
Style of text. | FlowElement | ||
| fontWeight : String [write-only] CharacterFormat:
Weight of text. | FlowElement | ||
| kerning : String [write-only] CharacterFormat:
Kerning adjusts the pixels between certain character pairs to improve readability. | FlowElement | ||
| ligatureLevel : String [write-only] CharacterFormat:
Controls which of the ligatures that are defined in the font may be used in the text. | FlowElement | ||
| lineHeight : Object [write-only] CharacterFormat:
Leading controls for the text. | FlowElement | ||
| lineThrough : Object [write-only] CharacterFormat:
Strikethrough. | FlowElement | ||
| locale : String [write-only] CharacterFormat:
The locale of the text. | FlowElement | ||
| parent : FlowGroupElement [read-only] Returns the parent of this FlowElement object. | FlowElement | ||
| parentRelativeEnd : int [read-only] Returns the relative end of this FlowElement object in the parent. | FlowElement | ||
| parentRelativeStart : int [read-only] Returns the relative start of this FlowElement object in the parent. | FlowElement | ||
![]() | prototype : Object [static] A reference to the prototype object of a class or function object. | Object | |
| renderingMode : String [write-only] CharacterFormat:
The rendering mode used for this text. | FlowElement | ||
| textAlpha : Object [write-only] CharacterFormat:
Alpha (transparency) value for the text. | FlowElement | ||
| textDecoration : String [write-only] CharacterFormat:
Decoration on text. | FlowElement | ||
| textLength : int [read-only] Returns the total length of text owned by this FlowElement object and its children. | FlowElement | ||
| textRotation : String [write-only] CharacterFormat:
Determines the amount of degrees to rotate this text. | FlowElement | ||
| tracking : Object [write-only] Sets the tracking and is synonymous with the trackingRight property. | FlowElement | ||
| trackingLeft : Object [write-only] CharacterFormat:
Number in pixels (or percent of fontSize, like 120%) indicating the amount of tracking (manual kerning) to be applied to the left of each character. | FlowElement | ||
| trackingRight : Object [write-only] CharacterFormat:
Number in pixels (or percent of fontSize, like 120%) indicating the amount of tracking (manual kerning) to be applied to the right of each character. | FlowElement | ||
| typographicCase : String [write-only] CharacterFormat:
The type of typographic case used for this text. | FlowElement | ||
| whiteSpaceCollapse : String [write-only] CharacterFormat:
The setting used to collapse or preserve whitespace when importing text into a TextFlow. | FlowElement | ||
| Method | Defined By | ||
|---|---|---|---|
Base class - invoking new FlowElement() throws an error exception. | FlowElement | ||
Makes a deep copy of the portion of a FlowElement object between two character positions, including any children,
and returns it as a FlowElement object. | FlowElement | ||
Returns the start location of the element in the text flow as an absolute index. | FlowElement | ||
Returns the ContainerFormattedElement that specifies its containers for filling. | FlowElement | ||
Returns the character at the specified position, relative to this FlowElement object. | FlowElement | ||
Returns the character code at the specified position, relative to this FlowElement. | FlowElement | ||
Returns the start of this element relative to an ancestor element. | FlowElement | ||
Returns the next FlowElement sibling in the text flow hierarchy. | FlowElement | ||
Returns the ParagraphElement object associated with this element. | FlowElement | ||
Returns the previous FlowElement sibling in the text flow hierarchy. | FlowElement | ||
Climbs the text flow hierarchy to return the root TextFlow object for the element. | FlowElement | ||
![]() | Indicates whether an object has a specified property defined. | Object | |
![]() | Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() | Indicates whether the specified property exists and is enumerable. | Object | |
![]() | Sets the availability of a dynamic property for loop operations. | Object | |
Makes a copy of the content of this FlowElement object that occurs between two character positions. | FlowElement | ||
![]() | Returns the string representation of the specified object. | Object | |
![]() | Returns the primitive value of the specified object. | Object | |
| alignmentBaseline | property |
alignmentBaseline:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Specifies the line baseline to which the element baseline specified by the
elementBaseline
property should align to determine the vertical position of the element on the line. The largest element in the line generally determines the baselines.
Legal values are flash.text.engine.TextBaseline.ROMAN, flash.text.engine.TextBaseline.ASCENT, flash.text.engine.TextBaseline.DESCENT, flash.text.engine.TextBaseline.IDEOGRAPHIC_TOP, flash.text.engine.TextBaseline.IDEOGRAPHIC_CENTER, flash.text.engine.TextBaseline.IDEOGRAPHIC_BOTTOM, flash.text.engine.TextBaseline.USE_DOMINANT_BASELINE.
Default value is USE_DOMINANT_BASELINE.
Values may be null indicating not set.
public function set alignmentBaseline(value:String):voidSee also
| baselineShift | property |
baselineShift:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Amount to shift the baseline from the
elementBaseline
. Units are in pixels, or a percentage of the fontSize (in which case, enter a string value, like 140%). Positive values shift the line down for horizontal text (left for vertical) and negative values shift it up for horizontal (right for vertical).
Legal values are flashx.textLayout.formats.BaselineShift.SUPERSCRIPT, flashx.textLayout.formats.BaselineShift.SUBSCRIPT.
Legal values as a number are from -1000 to 1000.
Legal values as a percent are from -1000 to 1000.
Default value is 0.0.
Values may be null indicating not set.
public function set baselineShift(value:Object):voidSee also
| breakOpportunity | property |
breakOpportunity:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Controls where lines are allowed to break when wrapping text is broken into multiple lines. AUTOMATIC is for setting text normally. NONE means that the line breaker will not break the text unless there are no other places to break the line and the text would otherwise overrun the measure. ANY allows the line to break anywhere, not just between words. ALL means that each typographic cluster will be put on a separate line (useful for text on a path).
Legal values are flash.text.engine.BreakOpportunity.ALL, flash.text.engine.BreakOpportunity.ANY, flash.text.engine.BreakOpportunity.AUTO, flash.text.engine.BreakOpportunity.NONE.
Default value is AUTO.
Values may be null indicating not set.
public function set breakOpportunity(value:String):voidSee also
| cffHinting | property |
cffHinting:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
The type of CFF hinting used for this text. CFF hinting determines whether Flash Player forces strong horizontal stems to fit to a sub pixel grid or not. This property applies only if the
renderingMode
property is set to flash.text.engine.RenderingMode.CFF, and the font is embedded (
fontLookup
property is set to flash.text.engine.FontLookup.EMBEDDED_CFF). At small screen sizes, hinting produces a clear, legible text for human readers.
Legal values are flash.text.engine.CFFHinting.NONE, flash.text.engine.CFFHinting.HORIZONTAL_STEM.
Default value is HORIZONTAL_STEM.
Values may be null indicating not set.
public function set cffHinting(value:String):voidSee also
| characterFormat | property |
characterFormat:ICharacterFormat [read-write] CharacterFormat properties applied directly to this element.
Each element may have properties applied to it as part of its format. Properties applied to this element override properties inherited from the parent. Properties applied to this element will in turn be inherited by element's children if they are not overridden on the child. If no properties are applied to the element, this will be null.
public function get characterFormat():ICharacterFormat public function set characterFormat(value:ICharacterFormat):voidSee also
| color | property |
color:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Color of the text. An integer containing three 8-bit RGB components; for example, 0xFF0000 is red and 0x00FF00 is green.
Default value is 0.
Values may be null indicating not set.
public function set color(value:Object):void| digitCase | property |
digitCase:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: The type of digit case used for this text. The OLD_STYLE setting approximates lowercase letterforms with varying ascenders and descenders. The figures are proportionally spaced. This style is only available in selected typefaces, most commonly in a supplemental or expert font. The LINING setting has all-cap height and is typically monospaced to line up in charts.
Legal values are flash.text.engine.DigitCase.DEFAULT, flash.text.engine.DigitCase.LINING, flash.text.engine.DigitCase.OLD_STYLE.
Default value is DEFAULT.
Values may be null indicating not set.
public function set digitCase(value:String):voidSee also
| digitWidth | property |
digitWidth:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Type of digit width used for this text. This can be PROPORTIONAL, which looks best for individual numbers, or TABULAR, which works best for numbers in tables, charts, and vertical rows.
Legal values are flash.text.engine.DigitWidth.DEFAULT, flash.text.engine.DigitWidth.PROPORTIONAL, flash.text.engine.DigitWidth.TABULAR.
Default value is DEFAULT.
Values may be null indicating not set.
public function set digitWidth(value:String):voidSee also
| dominantBaseline | property |
dominantBaseline:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Specifies which of the baselines of the element snaps to the
alignmentBaseline
to determine the vertical position of the element on the line. These baseline choices are determined by the choice of font and the font size.
Legal values are flash.text.engine.TextBaseline.ROMAN, flash.text.engine.TextBaseline.ASCENT, flash.text.engine.TextBaseline.DESCENT, flash.text.engine.TextBaseline.IDEOGRAPHIC_TOP, flash.text.engine.TextBaseline.IDEOGRAPHIC_CENTER, flash.text.engine.TextBaseline.IDEOGRAPHIC_BOTTOM.
Default value is ROMAN.
Values may be null indicating not set.
public function set dominantBaseline(value:String):voidSee also
| fontFamily | property |
fontFamily:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: The name of the font to use, or a comma-separated list of font names. Flash Player renders the element with the first available font in the list. For example Arial, Helvetica, _sans causes the player to search for Arial, then Helvetica if Arial is not found, then _sans if neither is found.
Default value is Times New Roman.
Values may be null indicating not set.
public function set fontFamily(value:String):void| fontLookup | property |
fontLookup:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Font lookup to use. Specifying a Device font uses the fonts installed on the system that is running the SWF file. Device fonts result in a smaller movie size, but text is not always rendered the same across different systems and platforms. Specifying an Embedded_CFF font uses font outlines embedded in the published SWF file. Embedded fonts increase the size of the SWF file (sometimes dramatically), text is consistently displayed in the chosen font.
Legal values are flash.text.engine.FontLookup.DEVICE, flash.text.engine.FontLookup.EMBEDDED_CFF.
Default value is DEVICE.
Values may be null indicating not set.
public function set fontLookup(value:String):voidSee also
| fontSize | property |
fontSize:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: The size of the text in pixels.
Legal values are from 1 to 720.
Default value is 12.
Values may be null indicating not set.
public function set fontSize(value:Object):void| fontStyle | property |
fontStyle:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Style of text. May be normal, for use in plain text, or italic. Applies only to device fonts (
fontLookup
property is set to flash.text.engine.FontLookup.DEVICE).
Legal values are flash.text.engine.FontPosture.NORMAL, flash.text.engine.FontPosture.ITALIC.
Default value is NORMAL.
Values may be null indicating not set.
public function set fontStyle(value:String):voidSee also
| fontWeight | property |
fontWeight:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Weight of text. May be normal, for use in plain text, or bold. Applies only to device fonts (
fontLookup
property is set to flash.text.engine.FontLookup.DEVICE).
Legal values are flash.text.engine.FontWeight.NORMAL, flash.text.engine.FontWeight.BOLD.
Default value is NORMAL.
Values may be null indicating not set.
public function set fontWeight(value:String):voidSee also
| kerning | property |
kerning:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Kerning adjusts the pixels between certain character pairs to improve readability. Kerning is supported for all fonts with kerning tables.
Legal values are flash.text.engine.Kerning.ON, flash.text.engine.Kerning.OFF, flash.text.engine.Kerning.AUTO.
Default value is ON.
Values may be null indicating not set.
public function set kerning(value:String):voidSee also
| ligatureLevel | property |
ligatureLevel:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Controls which of the ligatures that are defined in the font may be used in the text. The ligatures that appear for each of these settings is dependent on the font. A ligature occurs where two or more letter-forms are joined as a single glyph. Ligatures usually replace consecutive characters sharing common components, such as the letter pairs 'fi', 'fl', or 'ae'. They are used with both Latin and Non-Latin character sets. The ligatures enabled by the values MINIMUM, COMMON, UNCOMMON, and EXOTIC are additive - each value enables a new set of ligatures, but also includes those of the previous types.
Note:
When working with Arabic or Syriac fonts,
ligatureLevel
must be set to MINIMUM or above.
Legal values are flash.text.engine.LigatureLevel.NONE, flash.text.engine.LigatureLevel.MINIMUM, flash.text.engine.LigatureLevel.COMMON, flash.text.engine.LigatureLevel.UNCOMMON, flash.text.engine.LigatureLevel.EXOTIC.
Default value is COMMON.
Values may be null indicating not set.
public function set ligatureLevel(value:String):voidSee also
| lineHeight | property |
lineHeight:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Leading controls for the text. The distance from the baseline of the previous or the next line (based on
LeadingDirection
) to the baseline of the current line is equal to the maximum amount of the leading applied to any character in the line. This is either a number or a percent. If specifying a percent, enter a string value, like 140%.
Legal values as a number are from 0 to 720.
Legal values as a percent are from 0% to 1000%.
Default value is 120%.
Values may be null indicating not set.
public function set lineHeight(value:Object):void| lineThrough | property |
lineThrough:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Strikethrough. If true, a line is drawn throught the middle of the text.
Legal values are from false to true.
Default value is false.
Values may be null indicating not set.
public function set lineThrough(value:Object):void| locale | property |
locale:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: The locale of the text. Controls case transformations and shaping. Standard locale identifiers are used. For example en, en_US and en-US are all English, ja is Japanese.
Default value is en.
Values may be null indicating not set.
public function set locale(value:String):void| parent | property |
parent:FlowGroupElement [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the parent of this FlowElement object. Every FlowElement has at most one parent.
public function get parent():FlowGroupElement| parentRelativeEnd | property |
parentRelativeEnd:int [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the relative end of this FlowElement object in the parent. If the parent is null this is always equal to
textLength
. If
the parent is not null, the value is the sum of the text lengths of this and all previous siblings, which is effectively
the first character in the next FlowElement object.
public function get parentRelativeEnd():intSee also
| parentRelativeStart | property |
parentRelativeStart:int [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the relative start of this FlowElement object in the parent. If parent is null, this value is always zero. If parent is not null, the value is the sum of the text lengths of all previous siblings.
public function get parentRelativeStart():intSee also
| renderingMode | property |
renderingMode:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
The rendering mode used for this text. Applies only to embedded fonts (
fontLookup
property is set to flash.text.engine.FontLookup.EMBEDDED_CFF).
Legal values are flash.text.engine.RenderingMode.NORMAL, flash.text.engine.RenderingMode.CFF.
Default value is CFF.
Values may be null indicating not set.
public function set renderingMode(value:String):voidSee also
| textAlpha | property |
textAlpha:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Alpha (transparency) value for the text. A value of 0 is fully transparent, and a value of 1 is fully opaque. Display objects with alpha set to 0 are active, even though they are invisible.
Legal values are from 0 to 1.
Default value is 1.
Values may be null indicating not set.
public function set textAlpha(value:Object):void| textDecoration | property |
textDecoration:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Decoration on text. By default this is none, but underline may be applied.
Legal values are flashx.textLayout.formats.TextDecoration.NONE, flashx.textLayout.formats.TextDecoration.UNDERLINE.
Default value is NONE.
Values may be null indicating not set.
public function set textDecoration(value:String):voidSee also
| textLength | property |
textLength:int [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the total length of text owned by this FlowElement object and its children. If an element has no text, the
value of
textLength
is usually zero.
ParagraphElement objects have a final span with a paragraph terminator character for the last
SpanElement object.The paragraph terminator is included in the value of the
textLength
of that
SpanElement object and all its parents. It is not included in
text
property of the SpanElement
object.
public function get textLength():intSee also
| textRotation | property |
textRotation:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: Determines the amount of degrees to rotate this text.
Legal values are flash.text.engine.TextRotation.ROTATE_0, flash.text.engine.TextRotation.ROTATE_180, flash.text.engine.TextRotation.ROTATE_270, flash.text.engine.TextRotation.ROTATE_90, flash.text.engine.TextRotation.AUTO.
Default value is AUTO.
Values may be null indicating not set.
public function set textRotation(value:String):voidSee also
| tracking | property |
tracking:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Sets the tracking and is synonymous with the
trackingRight
property. Specified as a number of
pixels or a percent of
fontSize
.
public function set tracking(value:Object):voidSee also
| trackingLeft | property |
trackingLeft:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Number in pixels (or percent of fontSize, like 120%) indicating the amount of tracking (manual kerning) to be applied to the left of each character. If kerning is enabled, the
trackingLeft
value is added to the values in the kerning table for the font. If kerning is disabled, the
trackingLeft
value is used as a manual kerning value. Supports both positive and negative values.
Legal values as a number are from -100 to 100.
Legal values as a percent are from -100% to 100%.
Default value is 0.
Values may be null indicating not set.
public function set trackingLeft(value:Object):void| trackingRight | property |
trackingRight:Object [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat:
Number in pixels (or percent of fontSize, like 120%) indicating the amount of tracking (manual kerning) to be applied to the right of each character. If kerning is enabled, the
trackingRight
value is added to the values in the kerning table for the font. If kerning is disabled, the
trackingRight
value is used as a manual kerning value. Supports both positive and negative values.
Legal values as a number are from -100 to 100.
Legal values as a percent are from -100% to 100%.
Default value is 0.
Values may be null indicating not set.
public function set trackingRight(value:Object):void| typographicCase | property |
typographicCase:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: The type of typographic case used for this text. Below are some examples:
Legal values are flash.text.engine.TypographicCase.DEFAULT, flash.text.engine.TypographicCase.TITLE, flash.text.engine.TypographicCase.CAPS, flash.text.engine.TypographicCase.SMALL_CAPS, flash.text.engine.TypographicCase.UPPERCASE, flash.text.engine.TypographicCase.LOWERCASE, flash.text.engine.TypographicCase.CAPS_AND_SMALL_CAPS.
Default value is DEFAULT.
Values may be null indicating not set.
public function set typographicCase(value:String):voidSee also
| whiteSpaceCollapse | property |
whiteSpaceCollapse:String [write-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
CharacterFormat: The setting used to collapse or preserve whitespace when importing text into a TextFlow. PRESERVE retains all whitespace characters. When using COLLAPSE, within a block of imported text, newlines, tabs, and leading/trailing spaces will be removed. Line break tags () and Unicode line separator characters are retained.
Legal values are flashx.textLayout.formats.WhiteSpaceCollapse.PRESERVE, flashx.textLayout.formats.WhiteSpaceCollapse.COLLAPSE.
Default value is COLLAPSE.
Values may be null indicating not set.
public function set whiteSpaceCollapse(value:String):voidSee also
| FlowElement | () | Constructor |
public function FlowElement()| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Base class - invoking
new FlowElement()
throws an error exception.
| deepCopy | () | method |
public function deepCopy(relativeStart:int = 0, relativeEnd:int = -1):FlowElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Makes a deep copy of the portion of a FlowElement object between two character positions, including any children, and returns it as a FlowElement object.
With no arguments,
deepCopy()
defaults to copying the entire element.
Parameters
relativeStart:int (default = 0) — relative text position of the first character to copy. First position is 0. | |
relativeEnd:int (default = -1) — relative text position of the last character to copy. A value of -1 indicates copy to end. |
FlowElement — the object created by the deep copy operation. |
See also
| getAbsoluteStart | () | method |
public function getAbsoluteStart():int| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the start location of the element in the text flow as an absolute index. The first character in the flow is position 0.
Returnsint — The index of the start of the element from the start of the TextFlow object. |
See also
span2.getAbsoluteStart()
.
package {
import flash.display.Sprite;
import flashx.textLayout.container.DisplayObjectContainerController;
import flashx.textLayout.container.IContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.CharacterFormat;
public class FlowElement_getAbsoluteStartExample extends Sprite
{
public function FlowElement_getAbsoluteStartExample()
{
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span1:SpanElement = new SpanElement();
var span2:SpanElement = new SpanElement();
span1.text = "Hello, ";
span2.text = "World!";
p.fontSize = 48;
p.addChild(span1);
p.addChild(span2);
textFlow.addChild(p);
trace(span2.getAbsoluteStart()); // 7
textFlow.flowComposer.addController(new DisplayObjectContainerController(this,400,200));
textFlow.flowComposer.updateAllContainers();
}
}
}| getAncestorWithContainer | () | method |
public function getAncestorWithContainer():ContainerFormattedElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the ContainerFormattedElement that specifies its containers for filling. This ContainerFormattedElement object has its own columns and can control ColumnDirection and BlockProgression.
ReturnsContainerFormattedElement — the ancestor, with its container, of this FlowElement object. |
| getCharAtPosition | () | method |
public function getCharAtPosition(relativePos:int):String| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the character at the specified position, relative to this FlowElement object. The first character is at relative position 0.
Parameters
relativePos:int — The relative position of the character in this FlowElement object. |
String — String containing the character. |
| getCharCodeAtPosition | () | method |
public function getCharCodeAtPosition(relativePos:int):int| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the character code at the specified position, relative to this FlowElement. The first character is at relative position 0.
Parameters
relativePos:int — The relative position of the character in this FlowElement object. |
int — the Unicode value for the character at the specified position. |
| getElementRelativeStart | () | method |
public function getElementRelativeStart(ancestorElement:FlowElement):int| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the start of this element relative to an ancestor element. Assumes that the
ancestor element is in the parent chain. If the ancestor element is the parent, this is the
same as
this.parentRelativeStart
. If the ancestor element is the grandparent, this is the same as
parentRelativeStart
plus
parent.parentRelativeStart
and so on.
Parameters
ancestorElement:FlowElement — The element from which you want to find the relative start of this element. |
int — the offset of this element. |
| getNextSibling | () | method |
public function getNextSibling():FlowElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the next FlowElement sibling in the text flow hierarchy.
ReturnsFlowElement — the next FlowElement object of the same type, or null if there is no sibling. |
span2.getNextSibling()
.
package {
import flash.display.Sprite;
import flashx.textLayout.container.DisplayObjectContainerController;
import flashx.textLayout.container.IContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.FlowElement;
import flashx.textLayout.formats.CharacterFormat;
public class FlowElement_getNextSiblingExample extends Sprite
{
public function FlowElement_getNextSiblingExample()
{
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span1:SpanElement = new SpanElement();
var span2:SpanElement = new SpanElement();
var nextSpanElement:SpanElement = new SpanElement();
span1.text = "Hello, ";
span2.text = "World!";
p.fontSize = 48;
p.addChild(span1);
p.addChild(span2);
textFlow.addChild(p);
nextSpanElement = SpanElement(span1.getNextSibling());
trace(nextSpanElement.text); // World!
textFlow.flowComposer.addController(new DisplayObjectContainerController(this,400,200));
textFlow.flowComposer.updateAllContainers();
}
}
}| getParagraph | () | method |
public function getParagraph():ParagraphElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the ParagraphElement object associated with this element. It looks up the text flow hierarchy and returns the first ParagraphElement object.
ReturnsParagraphElement — the ParagraphElement object that's associated with this FlowElement object. |
| getPreviousSibling | () | method |
public function getPreviousSibling():FlowElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the previous FlowElement sibling in the text flow hierarchy.
ReturnsFlowElement — the previous FlowElement object of the same type, or null if there is no previous sibling. |
span2.getPreviousSibling()
.
package {
import flash.display.Sprite;
import flashx.textLayout.container.DisplayObjectContainerController;
import flashx.textLayout.container.IContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.FlowElement;
import flashx.textLayout.formats.CharacterFormat;
public class FlowElement_getPreviousSiblingExample extends Sprite
{
public function FlowElement_getPreviousSiblingExample()
{
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span1:SpanElement = new SpanElement();
var span2:SpanElement = new SpanElement();
var prevSpanElement:SpanElement = new SpanElement();
span1.text = "Hello, ";
span2.text = "World!";
p.fontSize = 48;
p.addChild(span1);
p.addChild(span2);
textFlow.addChild(p);
prevSpanElement = SpanElement(span2.getPreviousSibling());
trace(prevSpanElement.text); // Hello,
textFlow.flowComposer.addController(new DisplayObjectContainerController(this,400,200));
textFlow.flowComposer.updateAllContainers();
}
}
}| getTextFlow | () | method |
public function getTextFlow():TextFlow| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Climbs the text flow hierarchy to return the root TextFlow object for the element.
ReturnsTextFlow — The root TextFlow object for this FlowElement object. |
See also
| shallowCopy | () | method |
public function shallowCopy(relativeStart:int = 0, relativeEnd:int = -1):FlowElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Makes a copy of the content of this FlowElement object that occurs between two character positions.
It returns the copy of the content as a new FlowElement object. Unlike
deepCopy()
,
shallowCopy()
does
not copy any of the children of this FlowElement.
With no arguments,
shallowCopy()
defaults to copying all of the content.
Parameters
relativeStart:int (default = 0) — The relative text position of the first character to copy. First position is 0. | |
relativeEnd:int (default = -1) — The relative text position of the last character to copy. A value of -1 indicates copy to end. |
FlowElement — the object created by the copy operation. |
See also
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/labs/textlayout/flashx/textLayout/elements/FlowElement.html