Packageflashx.textLayout.elements
Classpublic final class DivElement
InheritanceDivElement Inheritance ContainerFormattedElement Inheritance ParagraphFormattedElement Inheritance FlowGroupElement Inheritance FlowElement Inheritance Object

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

The DivElement class defines an element for grouping paragraphs (ParagraphElement objects). If you want a group of paragraphs to share the same attributes, you can group them in a DivElement object, apply the attributes to it. The paragraphs in the group will inherit the attributes from the DivElement object.

See also

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
 InheritedblockProgression : String
[write-only] ContainerFormat: Settings for line layout.
ContainerFormattedElement
 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
 InheritedcolumnCount : Object
[write-only] ContainerFormat: Number of text columns.
ContainerFormattedElement
 InheritedcolumnGap : Object
[write-only] ContainerFormat: Gutter space between the columns in pixels.
ContainerFormattedElement
 InheritedcolumnWidth : Object
[write-only] ContainerFormat: Width of column in pixels.
ContainerFormattedElement
 InheritedcomputedContainerFormat : IContainerFormat
[read-only] Returns computed values of the container attributes.
ContainerFormattedElement
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedcontainerFormat : IContainerFormat
ContainerFormat properties applied directly to this element.
ContainerFormattedElement
 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
 Inheriteddirection : String
[write-only] ParagraphFormat: Specifies the default bidi embedding level of the text in the text block.
ParagraphFormattedElement
 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
 InheritedfirstBaselineOffset : Object
[write-only] ContainerFormat: Position of the baseline of first line in the container (in pixels).
ContainerFormattedElement
 InheritedfirstBaselineOffsetBasis : String
[write-only] ContainerFormat: Specifies the baseline to which the firstBaselineOffset property refers.
ContainerFormattedElement
 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
 InheritedjustificationRule : String
[write-only] ParagraphFormat: Rule used to generate paragraph justification.
ParagraphFormattedElement
 InheritedjustificationStyle : String
[write-only] ParagraphFormat: The style used for justification of the paragraph.
ParagraphFormattedElement
 Inheritedkerning : String
[write-only] CharacterFormat: Kerning adjusts the pixels between certain character pairs to improve readability.
FlowElement
 InheritedleadingBasis : String
[write-only] ParagraphFormat: Specifies the baseline to which the lineHeight property refers.
ParagraphFormattedElement
 InheritedleadingDirection : String
[write-only] ParagraphFormat: Specifies the direction in which leading space is applied.
ParagraphFormattedElement
 InheritedligatureLevel : String
[write-only] CharacterFormat: Controls which of the ligatures that are defined in the font may be used in the text.
FlowElement
 InheritedlineBreak : String
[write-only] ContainerFormat: Controls word wrapping within the container.
ContainerFormattedElement
 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
 InheritedmarginBottom : Object
[write-only] ParagraphFormat: Amount of space in pixels to leave after the paragraph (a Number).
ParagraphFormattedElement
 InheritedmarginLeft : Object
[write-only] ParagraphFormat: Amount in pixels to indent the paragraph (a Number).
ParagraphFormattedElement
 InheritedmarginRight : Object
[write-only] ParagraphFormat: Amount in pixels to indent the right edge of the paragraph (a Number).
ParagraphFormattedElement
 InheritedmarginTop : Object
[write-only] ParagraphFormat: Amount of space in pixels to leave before the paragraph (a Number).
ParagraphFormattedElement
 InheritednumChildren : int
[read-only] Returns the number of FlowElement children that this FlowGroupElement object has.
FlowGroupElement
 InheritedpaddingBottom : Object
[write-only] ContainerFormat: Botttom inset in pixels.
ContainerFormattedElement
 InheritedpaddingLeft : Object
[write-only] ContainerFormat: Left inset in pixels.
ContainerFormattedElement
 InheritedpaddingRight : Object
[write-only] ContainerFormat: Right inset in pixels.
ContainerFormattedElement
 InheritedpaddingTop : Object
[write-only] ContainerFormat: Top inset in pixels.
ContainerFormattedElement
 InheritedparagraphFormat : IParagraphFormat
ParagraphFormat properties applied directly to this element.
ParagraphFormattedElement
 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
 InheritedtabStops : Array
[write-only] ParagraphFormat: Specifies the tab stops associated with the paragraph.
ParagraphFormattedElement
 InheritedtextAlign : String
[write-only] ParagraphFormat: Alignment of lines in the paragraph relative to the container.
ParagraphFormattedElement
 InheritedtextAlignLast : String
[write-only] ParagraphFormat: Alignment of the last (or only) line in the paragraph relative to the container in justified text.
ParagraphFormattedElement
 InheritedtextAlpha : Object
[write-only] CharacterFormat: Alpha (transparency) value for the text.
FlowElement
 InheritedtextDecoration : String
[write-only] CharacterFormat: Decoration on text.
FlowElement
 InheritedtextIndent : Object
[write-only] ParagraphFormat: Amount in pixels to indent the first line of the paragraph (a Number).
ParagraphFormattedElement
 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
 InheritedverticalAlign : String
[write-only] ContainerFormat: Vertical alignment or justification.
ContainerFormattedElement
 InheritedwhiteSpaceCollapse : String
[write-only] CharacterFormat: The setting used to collapse or preserve whitespace when importing text into a TextFlow.
FlowElement
Public Methods
 MethodDefined By
  
Constructor - creates a new DivElement object.
DivElement
 Inherited
Appends a child FlowElement object.
FlowGroupElement
 Inherited
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
 Inherited
findChildIndexAtPosition(relativePosition:int):int
Given a relative text position, find the index of the first child FlowElement that contains relative position.
FlowGroupElement
 Inherited
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
 Inherited
Returns the FlowElement child at the specified index.
FlowGroupElement
 Inherited
Searches in children for the specified FlowElement object and returns its index position.
FlowGroupElement
 Inherited
Return the effective column direction for this element.
ContainerFormattedElement
 Inherited
Returns the start of this element relative to an ancestor element.
FlowElement
 Inherited
Returns the first FlowLeafElement descendant of this element.
FlowGroupElement
 Inherited
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
 Inherited
Removes the specified child FlowElement object.
FlowGroupElement
 Inherited
Removes a child FlowElement object at the specified index position.
FlowGroupElement
 Inherited
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
 Inherited
Splits this object at the position specified by the childIndex parameter.
FlowGroupElement
 Inherited
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
Constructor Detail
DivElement()Constructor
public function DivElement()

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

Constructor - creates a new DivElement object.


Example

This example creates a DivElement with two paragraphs. The first paragraph has two spans with different attributes. The second paragraph has a single span.
  1. Add TextLayout to the library.
  2. Save this code as DivElementExample.as in the same directory as your FLA.
  3. Set the Class in the Properties window of the FLA to DivElementExample.
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;
    import flashx.textLayout.elements.DivElement;
    import flashx.textLayout.elements.BreakElement;
    
    public class DivElementExample extends Sprite{    
        var textFlow:TextFlow = new TextFlow();

        public function DivElementExample(){
        
            // create a div
            var div:DivElement = new DivElement();
            var paragraph1:ParagraphElement = new ParagraphElement();
            var be:BreakElement = new BreakElement();

            var p1Span1:SpanElement = new SpanElement();
            p1Span1.text = "It was a dark and stormy night. ";
            var p1Span2:SpanElement = new SpanElement();
            p1Span2.text = "The quick red fox jumped over the lazy brown dog.";
            p1Span2.lineThrough = true;
            p1Span1.fontSize = p1Span2.fontSize = 14;
            paragraph1.addChild(p1Span1);
            paragraph1.addChild(p1Span2);
            paragraph1.addChild(be);

            div.addChild(paragraph1);
            
            var paragraph2:ParagraphElement = new ParagraphElement();
            var p2Span1:SpanElement = new SpanElement();
            p2Span1.text = "Peter Piper picked a peck of pickle peppers.";
            p2Span1.fontSize = 14;
            paragraph2.addChild(p2Span1);
            
            div.addChild(paragraph2);            
            textFlow.addChild(div);    

            textFlow.flowComposer.addController(new DisplayObjectContainerController(this,600,600));
            textFlow.flowComposer.updateAllContainers();
        }
    }
}




 

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/DivElement.html