Package | flashx.textLayout.elements |
Class | public final class DivElement |
Inheritance | DivElement ContainerFormattedElement ParagraphFormattedElement FlowGroupElement FlowElement Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Default MXML PropertymxmlChildren
See also
Public Properties
Public Methods
Method | Defined By | ||
---|---|---|---|
Constructor - creates a new DivElement object. | DivElement | ||
Appends a child FlowElement object. | FlowGroupElement | ||
Adds a child FlowElement object at the specified index position. | FlowGroupElement | ||
Clears the style specified by the styleProp parameter from this FlowElement object. | FlowElement | ||
Makes a deep copy of this FlowElement object, including any children, copying the content between the two specified
character positions and returning the copy as a FlowElement object. | FlowElement | ||
Compare the userStyles of this with otherElement's userStyles. | FlowElement | ||
Given a relative text position, find the index of the first child FlowElement that contains the 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 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 group. | FlowGroupElement | ||
Returns the last FlowLeafElement descendent of this group. | 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 | ||
Returns the value of the style specified by the styleProp parameter, which specifies
the style name and can include any user style name. | FlowElement | ||
[override] | FlowGroupElement | ||
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 | ||
Called for MXML objects after the implementing object has been created and all component properties specified on the MXML tag have been initialized. | FlowElement | ||
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 from the group. | FlowGroupElement | ||
Removes the 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 | ||
Sets the style specified by the styleProp parameter to the value specified by the
newValue parameter. | FlowElement | ||
Makes a copy of this FlowElement object, copying the content between two specified character positions. | FlowElement | ||
Splits this object at the position specified by the childIndex parameter. | FlowGroupElement | ||
Splits this FlowElement object at the position specified by the relativePosition parameter, which is
a relative position in the text for this element. | FlowElement | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
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.
Examples ( How to use this example )
DivElementExample.as
This example creates a DivElement that specifies formatting for its
two paragraphs. The second span in the first paragraph specifies additional formatting
that applies only to it.
package flashx.textLayout.elements.examples { import flash.display.Sprite; import flash.text.engine.FontPosture; import flashx.textLayout.compose.StandardFlowComposer; import flashx.textLayout.container.ContainerController; import flashx.textLayout.elements.DivElement; import flashx.textLayout.elements.ParagraphElement; import flashx.textLayout.elements.SpanElement; import flashx.textLayout.elements.TextFlow; public class DivElementExample extends Sprite{ public function DivElementExample(){ // create a container and a TextFlow object var firstContainer:Sprite = new Sprite(); this.stage.addChild(firstContainer); var textFlow:TextFlow = new TextFlow(); // create a DivElement that sets some formatting attributes var div:DivElement = new DivElement(); div.fontSize = 14; div.color = 0xFF3300; div.fontStyle = FontPosture.ITALIC; div.textIndent = 15; // create two paragraphs that inherit formatting from the DivElement var paragraph1:ParagraphElement = new ParagraphElement(); 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."; // specify lineThrough for this span only p1Span2.lineThrough = true; paragraph1.addChild(p1Span1); paragraph1.addChild(p1Span2); var paragraph2:ParagraphElement = new ParagraphElement(); var p2Span1:SpanElement = new SpanElement(); p2Span1.text = "Peter Piper picked a peck of pickle peppers."; paragraph2.addChild(p2Span1); // add the two paragraphs to the DivElement div.addChild(paragraph1); div.addChild(paragraph2); // add the DivElement to the TextFlow, add a composer, and update the controller // to display the text flow textFlow.addChild(div); textFlow.flowComposer = new StandardFlowComposer(); var firstController:ContainerController = new ContainerController(firstContainer, 200, 200 ); textFlow.flowComposer.addController(firstController); textFlow.flowComposer.updateAllControllers(); } } }
Fri Mar 19 2010, 02:45 AM -07:00