Package | flashx.textLayout.elements |
Class | public final class BreakElement |
Inheritance | BreakElement SpecialCharacterElement SpanElement FlowLeafElement FlowElement Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Note: This class exists primarily to support break tags in MXML markup. To create line breaks, you can add newline characters (\n) directly into the text like this:
spanElement1.text += '\n';
Default MXML PropertymxmlChildren
See also
Method | Defined By | ||
---|---|---|---|
Constructor. | BreakElement | ||
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 elem. | FlowElement | ||
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 FontMetrics object for the span. | 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 | ||
Returns the value of the style specified by the styleProp parameter, which specifies
the style name and can include any user style name. | 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 | ||
Updates the text in text span based on the specified start and end positions. | SpanElement | ||
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 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 |
BreakElement | () | Constructor |
public function BreakElement()
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Constructor.
package { import flash.display.Sprite; import flashx.textLayout.container.ContainerController; import flashx.textLayout.elements.ParagraphElement; import flashx.textLayout.elements.SpanElement; import flashx.textLayout.elements.TextFlow; import flashx.textLayout.elements.BreakElement; public class BreakElementExample extends Sprite { public function BreakElementExample() { var textFlow:TextFlow = new TextFlow(); var p:ParagraphElement = new ParagraphElement(); var span1:SpanElement = new SpanElement(); var span2:SpanElement = new SpanElement(); var be:BreakElement = new BreakElement(); span1.text = "Hello, "; span2.text = "World!"; span1.fontSize = span2.fontSize = 48; p.addChild(span1); p.addChild(be); p.addChild(span2); textFlow.addChild(p); textFlow.flowComposer.addController(new ContainerController(this,400,200)); textFlow.flowComposer.updateAllContainers(); } } }