Packageflashx.textLayout.elements
Classpublic class FlowGroupElement
InheritanceFlowGroupElement Inheritance FlowElement Inheritance Object
Subclasses ParagraphFormattedElement, SubParagraphGroupElement

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

The FlowGroupElement class is the base class for FlowElement objects that can have an array of children. These classes include TextFlow, ParagraphElement, DivElement, and LinkElement.

You cannot create a FlowGroupElement object directly. Invoking new FlowElement() throws an error exception.

Default MXML PropertymxmlChildren

See also

DivElement
LinkElement
ParagraphElement
TextFlow


Public Properties
 PropertyDefined By
 InheritedalignmentBaseline : 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
 InheritedbaselineShift : Object
[write-only] CharacterFormat: Amount to shift the baseline from the elementBaseline.
FlowElement
 InheritedbreakOpportunity : String
[write-only] CharacterFormat: Controls where lines are allowed to break when wrapping text is broken into multiple lines.
FlowElement
 InheritedcffHinting : String
[write-only] CharacterFormat: The type of CFF hinting used for this text.
FlowElement
 InheritedcharacterFormat : ICharacterFormat
CharacterFormat properties applied directly to this element.
FlowElement
 Inheritedcolor : Object
[write-only] CharacterFormat: Color of the text.
FlowElement
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheriteddigitCase : String
[write-only] CharacterFormat: The type of digit case used for this text.
FlowElement
 InheriteddigitWidth : String
[write-only] CharacterFormat: Type of digit width used for this text.
FlowElement
 InheriteddominantBaseline : 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
 InheritedfontFamily : String
[write-only] CharacterFormat: The name of the font to use, or a comma-separated list of font names.
FlowElement
 InheritedfontLookup : String
[write-only] CharacterFormat: Font lookup to use.
FlowElement
 InheritedfontSize : Object
[write-only] CharacterFormat: The size of the text in pixels.
FlowElement
 InheritedfontStyle : String
[write-only] CharacterFormat: Style of text.
FlowElement
 InheritedfontWeight : String
[write-only] CharacterFormat: Weight of text.
FlowElement
 Inheritedkerning : String
[write-only] CharacterFormat: Kerning adjusts the pixels between certain character pairs to improve readability.
FlowElement
 InheritedligatureLevel : String
[write-only] CharacterFormat: Controls which of the ligatures that are defined in the font may be used in the text.
FlowElement
 InheritedlineHeight : Object
[write-only] CharacterFormat: Leading controls for the text.
FlowElement
 InheritedlineThrough : Object
[write-only] CharacterFormat: Strikethrough.
FlowElement
 Inheritedlocale : 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
 Inheritedparent : FlowGroupElement
[read-only] Returns the parent of this FlowElement object.
FlowElement
 InheritedparentRelativeEnd : int
[read-only] Returns the relative end of this FlowElement object in the parent.
FlowElement
 InheritedparentRelativeStart : int
[read-only] Returns the relative start of this FlowElement object in the parent.
FlowElement
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 InheritedrenderingMode : String
[write-only] CharacterFormat: The rendering mode used for this text.
FlowElement
 InheritedtextAlpha : Object
[write-only] CharacterFormat: Alpha (transparency) value for the text.
FlowElement
 InheritedtextDecoration : String
[write-only] CharacterFormat: Decoration on text.
FlowElement
 InheritedtextLength : int
[read-only] Returns the total length of text owned by this FlowElement object and its children.
FlowElement
 InheritedtextRotation : String
[write-only] CharacterFormat: Determines the amount of degrees to rotate this text.
FlowElement
 Inheritedtracking : Object
[write-only] Sets the tracking and is synonymous with the trackingRight property.
FlowElement
 InheritedtrackingLeft : 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
 InheritedtrackingRight : 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
 InheritedtypographicCase : String
[write-only] CharacterFormat: The type of typographic case used for this text.
FlowElement
 InheritedwhiteSpaceCollapse : String
[write-only] CharacterFormat: The setting used to collapse or preserve whitespace when importing text into a TextFlow.
FlowElement
Public Methods
 MethodDefined 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
 Inherited
deepCopy(relativeStart:int = 0, relativeEnd:int = -1):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
  
findChildIndexAtPosition(relativePosition:int):int
Given a relative text position, find the index of the first child FlowElement that contains relative position.
FlowGroupElement
  
findLeaf(relativePosition:int):FlowLeafElement
Given a relative text position, find the leaf element that contains the position.
FlowGroupElement
 Inherited
Returns the start location of the element in the text flow as an absolute index.
FlowElement
 Inherited
Returns the ContainerFormattedElement that specifies its containers for filling.
FlowElement
 Inherited
Returns the character at the specified position, relative to this FlowElement object.
FlowElement
 Inherited
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
 Inherited
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
 Inherited
Returns the next FlowElement sibling in the text flow hierarchy.
FlowElement
 Inherited
Returns the ParagraphElement object associated with this element.
FlowElement
 Inherited
Returns the previous FlowElement sibling in the text flow hierarchy.
FlowElement
 Inherited
Climbs the text flow hierarchy to return the root TextFlow object for the element.
FlowElement
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
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
  
replaceChildren(beginChildIndex:int, endChildIndex:int, ... rest):void
Replaces child elements in the group with the specified new elements.
FlowGroupElement
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
shallowCopy(relativeStart:int = 0, relativeEnd:int = -1):FlowElement
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
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail
numChildrenproperty
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.



Implementation
    public function get numChildren():int
Constructor Detail
FlowGroupElement()Constructor
public function FlowGroupElement()

Base class - invoking new FlowGroupElement() throws an error exception.

Method Detail
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


Throws
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

Returns
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

Returns
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

Returns
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.

Returns
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.

Returns
FlowLeafElement
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.

Returns
FlowLeafElement
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


Throws
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


Throws
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:

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.


Throws
RangeError — The beginChildIndex or endChildIndex specified is out of range.
 
ArgumentError — One or more new elements is still owned by another FlowGroupElement.

Example

This example calls 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

Returns
FlowGroupElement — the new shallowCopy

Throws
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

Returns
FlowGroupElement

Throws
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