| Package | flashx.textLayout.elements |
| Class | public class FlowLeafElement |
| Inheritance | FlowLeafElement FlowElement Object |
| Subclasses | InlineGraphicElement, SpanElement |
| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
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 | |
| computedCharacterFormat : ICharacterFormat [read-only] Returns the computed character format attributes that are in effect for this element. | FlowLeafElement | ||
![]() | 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 | |
| text : String [read-only] The text associated with the FlowLeafElement:
The value for SpanElement subclass will be one character less than textLength if this is the last span in a ParagraphELement.
The value for BreakElement subclass is a U+2028
The value for TabElement subclass is a tab
The value for InlineGraphicElement subclass is U+FDEF | FlowLeafElement | ||
![]() | 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 | |
| Property | Defined By | ||
|---|---|---|---|
| eventMirror : EventDispatcher [read-only] Gets the EventDispatcher associated with this FlowLeafElement. | FlowLeafElement | ||
| Method | Defined By | ||
|---|---|---|---|
![]() | 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 FontMetrics object for the span's character format (CharacterFormat). | FlowLeafElement | ||
![]() | Returns the start of this element relative to an ancestor element. | FlowElement | |
Returns the next FlowLeafElement object. | FlowLeafElement | ||
![]() | Returns the next FlowElement sibling in the text flow hierarchy. | FlowElement | |
![]() | Returns the ParagraphElement object associated with this element. | FlowElement | |
Returns the previous FlowLeafElement object. | FlowLeafElement | ||
![]() | 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 | |
| computedCharacterFormat | property |
computedCharacterFormat:ICharacterFormat [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the computed character format attributes that are in effect for this element. Takes into account the inheritance of attributes.
public function get computedCharacterFormat():ICharacterFormatSee also
| eventMirror | property |
eventMirror:EventDispatcher [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Gets the EventDispatcher associated with this FlowLeafElement. Use the functions
of EventDispatcher such as
setEventHandler()
and
removeEventHandler()
to capture events that happen over this FlowLeafElement object. The
event handler that you specify will be called after this FlowLeafElement object does
the processing it needs to do.
protected function get eventMirror():EventDispatcherSee also
| text | property |
text:String [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
The text associated with the FlowLeafElement:
textLength
if this is the last span in a ParagraphELement.
public function get text():StringSee also
| getComputedFontMetrics | () | method |
public function getComputedFontMetrics():FontMetrics| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the FontMetrics object for the span's character format (CharacterFormat). The properties of the FontMetrics object describe the emBox, strikethrough position, strikethrough thickness, underline position, and underline thickness for the specified font.
ReturnsFontMetrics — font metrics associated with the span |
See also
| getNextLeaf | () | method |
public function getNextLeaf(limitElement:FlowGroupElement = null):FlowLeafElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the next FlowLeafElement object.
Parameters
limitElement:FlowGroupElement (default = null) — Specifies FlowGroupElement on whose last leaf to stop looking. A value of null (default)
means search till no more elements. |
FlowLeafElement — next FlowLeafElement or null if at the end |
getNextLeaf()
to iterate forward through each leaf
element and trace its text, up to and including paragraph p2.
package {
import flash.display.Sprite;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.container.IContainerController;
import flashx.textLayout.container.DisplayObjectContainerController;
public class FlowLeafElement_getNextLeafExample extends Sprite{
var textFlow:TextFlow = new TextFlow();
public function FlowLeafElement_getNextLeafExample(){
var fontSize:Number = 12;
var textFlow:TextFlow = new TextFlow();
var p1:ParagraphElement = new ParagraphElement();
var p2:ParagraphElement = new ParagraphElement();
var p3:ParagraphElement = new ParagraphElement();
var p1Span1:SpanElement = new SpanElement();
var p1Span2:SpanElement = new SpanElement();
var p1Span3:SpanElement = new SpanElement();
var p2Span1:SpanElement = new SpanElement();
var p2Span2:SpanElement = new SpanElement();
var p2Span3:SpanElement = new SpanElement();
var p3Span1:SpanElement = new SpanElement();
var p3Span2:SpanElement = new SpanElement();
var p3Span3:SpanElement = new SpanElement();
p1Span1.text = "Breathe.";
p1Span1.fontSize = fontSize;
p1Span2.text = "Walk.";
p1Span2.fontSize = fontSize + 1;
p1Span3.text = "Play.";
p1Span3.fontSize = fontSize + 2;
p1.addChild(p1Span1);
p1.addChild(p1Span2);
p1.addChild(p1Span3);
p2Span1.text = "Study.";
p2Span1.fontSize = fontSize + 3;
p2Span2.text = "Work.";
p2Span2.fontSize = fontSize + 4;
p2Span3.text = "Marry.";
p2Span3.fontSize = fontSize + 5;
p2.fontSize = fontSize + 6;
p2.addChild(p2Span1);
p2.addChild(p2Span2);
p2.addChild(p2Span3);
p3Span1.text = "Retire.";
p3Span1.fontSize = fontSize + 6;
p3Span2.text = "Travel.";
p3Span2.fontSize = fontSize + 7;
p3Span3.text = "Rock." ;
p3Span3.fontSize = fontSize + 8;
p3.addChild(p3Span1);
p3.addChild(p3Span2);
p3.addChild(p3Span3);
textFlow.addChild(p1);
textFlow.addChild(p2);
textFlow.addChild(p3);
textFlow.flowComposer.addController(new DisplayObjectContainerController(this,600,600));
textFlow.flowComposer.updateAllContainers();
var leaf:SpanElement = new SpanElement();
leaf = SpanElement(textFlow.getFirstLeaf());
trace(leaf.text);
while(leaf = SpanElement(leaf.getNextLeaf(p2)))
trace(leaf.text);
}
}
}| getPreviousLeaf | () | method |
public function getPreviousLeaf(limitElement:FlowGroupElement = null):FlowLeafElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the previous FlowLeafElement object.
Parameters
limitElement:FlowGroupElement (default = null) — Specifies the FlowGroupElement on whose first leaf to stop looking. null (default) means search till no more elements. |
FlowLeafElement — previous leafElement or null if at the end |
getPreviousLeaf()
to iterate backward through each
leaf element and trace its text, through the limit element, paragraph p3.
package {
import flash.display.Sprite;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.container.IContainerController;
import flashx.textLayout.container.DisplayObjectContainerController;
public class FlowLeafElement_getPreviousLeafExample extends Sprite{
var textFlow:TextFlow = new TextFlow();
public function FlowLeafElement_getPreviousLeafExample(){
var fontSize:Number = 12;
var textFlow:TextFlow = new TextFlow();
var p1:ParagraphElement = new ParagraphElement();
var p2:ParagraphElement = new ParagraphElement();
var p3:ParagraphElement = new ParagraphElement();
var p1Span1:SpanElement = new SpanElement();
var p1Span2:SpanElement = new SpanElement();
var p1Span3:SpanElement = new SpanElement();
var p2Span1:SpanElement = new SpanElement();
var p2Span2:SpanElement = new SpanElement();
var p2Span3:SpanElement = new SpanElement();
var p3Span1:SpanElement = new SpanElement();
var p3Span2:SpanElement = new SpanElement();
var p3Span3:SpanElement = new SpanElement();
p1Span1.text = "Breathe.";
p1Span1.fontSize = fontSize;
p1Span2.text = "Walk.";
p1Span2.fontSize = fontSize + 1;
p1Span3.text = "Play.";
p1Span3.fontSize = fontSize + 2;
p1.addChild(p1Span1);
p1.addChild(p1Span2);
p1.addChild(p1Span3);
p2Span1.text = "Study.";
p2Span1.fontSize = fontSize + 3;
p2Span2.text = "Work.";
p2Span2.fontSize = fontSize + 4;
p2Span3.text = "Marry.";
p2Span3.fontSize = fontSize + 5;
p2.addChild(p2Span1);
p2.addChild(p2Span2);
p2.addChild(p2Span3);
p3Span1.text = "Retire.";
p3Span1.fontSize = fontSize + 6;
p3Span2.text = "Travel.";
p3Span2.fontSize = fontSize + 7;
p3Span3.text = "Rock.";
p3Span3.fontSize = fontSize + 8;
p3.addChild(p3Span1);
p3.addChild(p3Span2);
p3.addChild(p3Span3);
textFlow.addChild(p1);
textFlow.addChild(p2);
textFlow.addChild(p3);
textFlow.flowComposer.addController(new DisplayObjectContainerController(this,600,600));
textFlow.flowComposer.updateAllContainers();
var leaf:SpanElement = new SpanElement();
leaf = SpanElement(textFlow.getLastLeaf());
trace(leaf.text);
while(leaf = SpanElement(leaf.getPreviousLeaf(p3)))
trace(leaf.text);
}
}
}
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/FlowLeafElement.html