| Package | flashx.textLayout.elements |
| Class | public class FlowGroupElement |
| Inheritance | FlowGroupElement FlowElement Object |
| Subclasses | ParagraphFormattedElement, SubParagraphGroupElement |
| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
You cannot create a FlowGroupElement object directly. Invoking
new FlowElement()
throws an error
exception.
Default MXML PropertymxmlChildren
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 | |
| numChildren : int [read-only] Returns the number of FlowElement children that this FlowGroupElement object has. | FlowGroupElement | ||
![]() | 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 FlowGroupElement() throws an error exception. | FlowGroupElement | ||
Appends a child FlowElement object. | FlowGroupElement | ||
Adds a child FlowElement object at the specified index position. | FlowGroupElement | ||
![]() | 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 | |
Given a relative text position, find the index of the first child FlowElement that contains relative position. | FlowGroupElement | ||
Given a relative text position, find the leaf element that contains the position. | FlowGroupElement | ||
![]() | 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 FlowElement child at the specified index. | FlowGroupElement | ||
Searches in children for the specified FlowElement object and returns its index position. | FlowGroupElement | ||
![]() | Returns the start of this element relative to an ancestor element. | FlowElement | |
Returns the first FlowLeafElement descendant of this element. | FlowGroupElement | ||
Returns the last FlowLeafElement descendent of this element. | FlowGroupElement | ||
![]() | 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 | |
Removes the specified child FlowElement object. | FlowGroupElement | ||
Removes a child FlowElement object at the specified index position. | FlowGroupElement | ||
Replaces child elements in the group with the specified new elements. | FlowGroupElement | ||
![]() | 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 | |
Splits this object at the position specified by the childIndex parameter. | FlowGroupElement | ||
Splits this object at the position specified by the relativePosition parameter, where
the relative position is a relative text position in this element. | FlowGroupElement | ||
![]() | Returns the string representation of the specified object. | Object | |
![]() | Returns the primitive value of the specified object. | Object | |
| numChildren | property |
numChildren:int [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the number of FlowElement children that this FlowGroupElement object has.
public function get numChildren():int| FlowGroupElement | () | Constructor |
public function FlowGroupElement()
Base class - invoking
new FlowGroupElement()
throws an error exception.
| addChild | () | method |
public function addChild(child:FlowElement):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Appends a child FlowElement object. The new child is added to the end of the children list.
Parameters
child:FlowElement — child element to append |
| addChildAt | () | method |
public function addChildAt(index:uint, child:FlowElement):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Adds a child FlowElement object at the specified index position.
Parameters
index:uint — index to add the child element at | |
child:FlowElement — child element to add |
RangeError —
The
index
is out of range.
|
| findChildIndexAtPosition | () | method |
public function findChildIndexAtPosition(relativePosition:int):int| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Given a relative text position, find the index of the first child FlowElement that contains relative position. More than one child can contain relative position because of zero length FlowElements.
Examine the children to find the FlowElement that contains the relative position. The supplied relative position is relative to this FlowElement.
Parameters
relativePosition:int — position relative to this |
int —
index index of first child element containing
relativePosition
|
| findLeaf | () | method |
public function findLeaf(relativePosition:int):FlowLeafElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Given a relative text position, find the leaf element that contains the position.
Looks down the flow element hierarchy to find the element that is the FlowLeafElement containing the specified position. The specified position is relative to this FlowElement object.
Parameters
relativePosition:int — relative text index to look up |
FlowLeafElement — FlowLeafElement the leaf element containing the relative position |
| getChildAtIndex | () | method |
public function getChildAtIndex(i:int):FlowElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the FlowElement child at the specified index.
Parameters
i:int |
FlowElement |
| getChildIndex | () | method |
public function getChildIndex(child:FlowElement):int| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Searches in children for the specified FlowElement object and returns its index position.
Parameters
child:FlowElement — The item to find in the children. |
int — The index position of elem in the children. If elem is not found the return value is -1. |
| getFirstLeaf | () | method |
public function getFirstLeaf():FlowLeafElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the first FlowLeafElement descendant of this element.
ReturnsFlowLeafElement |
| getLastLeaf | () | method |
public function getLastLeaf():FlowLeafElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns the last FlowLeafElement descendent of this element.
ReturnsFlowLeafElement |
| removeChild | () | method |
public function removeChild(child:FlowElement):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Removes the specified child FlowElement object.
Parameters
child:FlowElement — child element to remove |
ArgumentError —
The
child
is not found.
|
| removeChildAt | () | method |
public function removeChildAt(index:uint):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Removes a child FlowElement object at the specified index position.
Parameters
index:uint — index at which to remove the child element |
RangeError —
The
index
is out of range.
|
| replaceChildren | () | method |
public function replaceChildren(beginChildIndex:int, endChildIndex:int, ... rest):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Replaces child elements in the group with the specified new elements. Use the
beginChildIndex
and
endChildIndex
parameters to govern the operation as follows:
beginChildIndex
and
endChildIndex
.
The new elements is inserted before the specified index.
numChildren
for
beginChildIndex
and
endChildIndex
.
Otherwise, this method replaces the specified elements, starting with the element at
beginChildIndex
and up to but not including
endChildIndex
.
Parameters
beginChildIndex:int — The index value for the start position of the replacement range in the children array. | |
endChildIndex:int — The index value following the end position of the replacement range in the children array. | |
... rest — The elements to replace the specified range of elements. Can be a sequence containing flow elements or
arrays or vectors thereof. |
RangeError —
The
beginChildIndex
or
endChildIndex
specified is out of range.
| |
ArgumentError — One or more new elements is still owned by another FlowGroupElement. |
replaceChildren()
to replace the
SpanElement objects in the second paragraph. It then iterates through
each leaf element and traces its text.
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 FlowGroupElement_replaceChildrenExample extends Sprite{
var textFlow:TextFlow = new TextFlow();
public function FlowGroupElement_replaceChildrenExample(){
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;
textFlow.addChild(p1);
textFlow.addChild(p2);
p2.replaceChildren(0, 3, p3Span1, p3Span2, p3Span3);
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()))
trace(leaf.text);
}
}
}| splitAtIndex | () | method |
public function splitAtIndex(childIndex:int):FlowGroupElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Splits this object at the position specified by the
childIndex
parameter. Creates a shallow copy of
this object and adds it to the parent after this object. Moves elements following
childIndex
into the copy.
Parameters
childIndex:int |
FlowGroupElement — the new shallowCopy |
RangeError — if childIndex is greater than childrenLength. |
| splitAtPosition | () | method |
public function splitAtPosition(relativePosition:int):FlowGroupElement| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Splits this object at the position specified by the
relativePosition
parameter, where
the relative position is a relative text position in this element.
Parameters
relativePosition:int |
FlowGroupElement |
RangeError — if characterIndex is greater than textLength, or less than 0. |
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/FlowGroupElement.html