| Package | flash.text.engine |
| Class | public class ContentElement |
| Inheritance | ContentElement Object |
| Subclasses | GraphicElement, GroupElement, TextElement |
| Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
ContentElement is an abstract base class; therefore, you cannot instantiate ContentElement directly.
Invoking new ContentElement() throws an ArgumentError exception.
A ContentElement can be in exactly one GroupElement or specified as the content of exactly one text block.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | |
| elementFormat : ElementFormat
The ElementFormat used for the element. | ContentElement | ||
| eventMirror : EventDispatcher
The EventDispatcher object that receives copies of every
event dispatched to text lines based on this content element. | ContentElement | ||
| groupElement : GroupElement [read-only]
The GroupElement which contains this element, or
null if it is not in a group. | ContentElement | ||
![]() | prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | |
| rawText : String [read-only]
A copy of the text in the element, including the U+FDEF characters representing graphic elements. | ContentElement | ||
| text : String [read-only]
A copy of the text in the element, not including the U+FDEF characters representing graphic elements. | ContentElement | ||
| textBlock : TextBlock [read-only]
The TextBlock to which this element belongs. | ContentElement | ||
| textBlockBeginIndex : int [read-only]
The index in the text block of the first character of this element. | ContentElement | ||
| textRotation : String
The rotation to apply to the element as a unit. | ContentElement | ||
| userData : *
Provides a way for the author to associate arbitrary data with the element. | ContentElement | ||
| Method | Defined By | ||
|---|---|---|---|
ContentElement(elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0")
Calling the new ContentElement() constructor throws an
ArgumentError exception. | ContentElement | ||
![]() |
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 | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object | |
| Constant | Defined By | ||
|---|---|---|---|
| GRAPHIC_ELEMENT : uint = 0xFDEF [static]
Used to indicate the presence a graphic element in the text. | ContentElement | ||
| elementFormat | property |
elementFormat:ElementFormat [read-write] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
The ElementFormat used for the element.
The default value is null.
Changing the properties of an ElementFormat object that has been applied to a TextElement does not invalidate the corresponding lines in a text block to which the TextElement belongs. Directly setting the ElementFormat object of the TextElement does invalidate those lines.
public function get elementFormat():ElementFormat public function set elementFormat(value:ElementFormat):voidSee also
| eventMirror | property |
eventMirror:EventDispatcher [read-write] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
The EventDispatcher object that receives copies of every
event dispatched to text lines based on this content element.
The specified object can be used to set up listeners for a text link or other
interactive piece of text, as it can be difficult to determine at runtime which parts
of which lines have resulted from which content elements.
You can also use listeners to apply decorations such as underlines, the metrics of which
you cannot determine until after the text is laid out.
The default value is null, which means no mirrored events will be dispatched.
Event mirrors manifest themselves in text lines as instances of the TextLineMirrorRegion
class. Depending on bidirectional processing and line breaking, one or more mirror regions can be produced.
The default value is null.
public function get eventMirror():EventDispatcher public function set eventMirror(value:EventDispatcher):voidSee also
| groupElement | property |
groupElement:GroupElement [read-only] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 9 |
The GroupElement which contains this element, or
null if it is not in a group.
The default value is null.
public function get groupElement():GroupElementSee also
| rawText | property |
rawText:String [read-only] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
A copy of the text in the element, including the U+FDEF characters representing graphic elements.
public function get rawText():String| text | property |
text:String [read-only] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
A copy of the text in the element, not including the U+FDEF characters representing graphic elements.
public function get text():StringSee also
| textBlock | property |
textBlock:TextBlock [read-only] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 9 |
The TextBlock to which this element belongs.
The default value is null.
public function get textBlock():TextBlockSee also
| textBlockBeginIndex | property |
textBlockBeginIndex:int [read-only] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 9 |
The index in the text block of the first character of this element. Note this value is not cached - it is calculated whenever this method is called.
The default value is 0.
public function get textBlockBeginIndex():int| textRotation | property |
textRotation:String [read-write] | Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
The rotation to apply to the element as a unit. Use TextRotation
constants for this property.
The default value is TextRotation.ROTATE_0.
The final rotation of any glyph is the sum of TextBlock.glyphRotation, ElementFormat.textRotation, ContentElement.textRotation, and TextBlock.lineRotation.
ContentElement.textRotation is used to create a short run of text whose
rotation differs from the containing line. TCY runs in Japanese text are an example.
To create a Paragraph of vertical Japanese text containing a TCY run, do the following:
TextBlock.glyphRotation=GlyphRotation.FULL_AND_WIDETextBlock.lineRotation=TextRotation.ROTATE_90TextBlock.content to a GroupElement, consisting of three TextElement objects.
The first of these elements is the Japanese text before the TCY run, the second is the Latin text of the TCY run, and the third is
the Japanese text after the TCY run.textRotation property of the TCY TextElement to TextRotation.ROTATE_270.
The TCY text element rotates as a unit. It starts with a 90 degree rotation inherited
from the line. Adding another 270 degrees takes it around to horizontal.Rotated content elements cannot be nested. In any hierarchy of content elements, no matter how complex,
only one content element can have its textRotation property set. The following methods and property setters throw an
argument error if nested rotations are detected:
ContentElement.textRotationGroupElement.setElementsGroupElement.replaceElementsTo set values for this property, use the following string values:
| String value | Description |
|---|---|
TextRotation.ROTATE_0 | Element is not rotated. |
TextRotation.ROTATE_90 | Element is rotated 90 degrees clockwise. |
TextRotation.ROTATE_180 | Element is rotated 180 degrees. |
TextRotation.ROTATE_270 | Element is rotated 270 degrees clockwise. |
public function get textRotation():String public function set textRotation(value:String):voidArgumentError — If set to any value which is not a member of TextRotation.
| |
ArgumentError — If the operation would result in nested rotations within a GroupElement.
|
See also
| userData | property |
public var userData:*| Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
Provides a way for the author to associate arbitrary data with the element.
The default value is null.
| ContentElement | () | Constructor |
public function ContentElement(elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0")| Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
Calling the new ContentElement() constructor throws an
ArgumentError exception. You can, however, call constructors for
the following subclasses of ContentElement:
new GraphicElement()new GroupElement()new TextElement()elementFormat:ElementFormat (default = null) — The element format for the text in the element. The default value is null.
| |
eventMirror:EventDispatcher (default = null) — The EventDispatcher object that receives copies of every
event dispatched to text lines created based on this content element. The default value is null.
| |
textRotation:String (default = "rotate0") — The rotation applied the element as a unit. Use TextRotation
constants for this property. The default value is TextRotation.ROTATE_0.
|
| GRAPHIC_ELEMENT | Constant |
public static const GRAPHIC_ELEMENT:uint = 0xFDEF| Language Version : | ActionScript 3.0 |
| Player Version : | Flash Player 10 |
Used to indicate the presence a graphic element in the text.
See also