Package | spark.components |
Class | public class Label |
Inheritance | Label TextBase UIComponent FlexSprite Sprite DisplayObjectContainer InteractiveObject DisplayObject EventDispatcher Object |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
text
property inherited from TextBase.
The formatting of the text is specified by the element's CSS styles,
such as fontFamily
and fontSize
.
Label uses of the Flash Text Engine (FTE) in Flash Player to provide high-quality international typography. Because Label is fast and lightweight, it is especially suitable for use cases that involve rendering many small pieces of non-interactive text, such as item renderers and labels in Button skins.
The Spark architecture provides three text "primitives" -- Label, RichText, and RichEditableText -- as part of its pay-only-for-what-you-need philosophy. Label is the fastest and most lightweight, but is limited in its capabilities: no complex formatting, no scrolling, no selection, no editing, and no hyperlinks. RichText and RichEditableText are built on the Text Layout Framework (TLF) library, rather than on FTE. RichText adds the ability to render rich HTML-like text with complex formatting, but is still completely non-interactive. RichEditableText is the slowest and heaviest, but can do it all: it supports scrolling with virtualized TextLines, selection, editing, hyperlinks, and images loaded from URLs. You should use the fastest one that meets your needs.
The Spark Label control is similar to the MX Label control, mx.controls.Label. The most important differences are:
- Spark Label uses FTE, the player's new text engine, while MX Label uses the TextField class.
- Spark Label offers better typography, and better support for international languages, than MX Label.
- Spark Label can display multiple lines, which MX Label cannot.
- MX Label can display a limited subset of HTML, while Spark Label can only display text with uniform formatting.
- MX Label can be made selectable, while Spark Label cannot.
In Spark Label, three character sequences are recognized
as explicit line breaks: CR ("\r"
), LF ("\n"
),
and CR+LF ("\r\n"
).
If you don't specify any kind of width for a Label, then the longest line, as determined by these explicit line breaks, determines the width of the Label.
If you do specify some kind of width, then the specified text is
word-wrapped at the right edge of the component's bounds, because the
default value of the lineBreak
style is "toFit"
.
If the text extends below the bottom of the component,
it is clipped.
To disable this automatic wrapping, set the lineBreak
style to "explicit"
. Then lines are broken only where
the text
contains an explicit line break,
and the ends of lines extending past the right edge is clipped.
If you have more text than you have room to display it,
Label can truncate the text for you.
Truncating text means replacing excess text
with a truncation indicator such as "...".
See the inherited properties maxDisplayedLines
and isTruncated
.
You can control the line spacing with the lineHeight
style.
You can horizontally and vertically align the text within the element's
bounds using the textAlign
, textAlignLast
,
and verticalAlign
styles.
You can inset the text from the element's edges using the
paddingLeft
, paddingTop
,
paddingRight
, and paddingBottom
styles.
By default a Label has no background,
but you can draw one using the backgroundColor
and backgroundAlpha
styles.
Borders are not supported.
If you need a border, or a more complicated background, use a separate
graphic element, such as a Rect, behind the Label.
Label supports displaying left-to-right (LTR) text such as French,
right-to-left (RTL) text such as Arabic, and bidirectional text
such as a French phrase inside of an Arabic paragraph.
If the predominant text direction is right-to-left,
set the direction
style to "rtl"
.
The textAlign
style defaults to "start"
,
which makes the text left-aligned when direction
is "ltr"
and right-aligned when direction
is "rtl"
.
To get the opposite alignment,
set textAlign
to "end"
.
Label uses the TextBlock class in the Flash Text Engine to create one or more TextLine objects to statically display its text String in the format determined by its CSS styles. For performance, its TextLines do not contain information about individual glyphs; for more info, see flash.text.engine.TextLineValidity.STATIC.
The Label control has the following default characteristics:
Characteristic | Description |
---|---|
Default size | 0 pixels wide by 12 pixels high if it contains no text, and large enough ti display the text if it does |
Minimum size | 0 pixels |
Maximum size | 10000 pixels wide and 10000 pixels high |
The <s:Label>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Label Properties fontContext="" Styles alignmentBaseline="baseline" baselineShift="0" cffHinting="0.0" color="0x000000" digitCase="default" digitWidth="default" direction="ltr" dominantBaseline="auto" fontFamily="Arial" fontLookup="embeddedCFF" fontSize="12" fontStyle="normal" fontWeight="normal" justificationRule="auto" justificationStyle="auto" kerning="false" ligatureLevel="common" lineBreak="toFit" lineHeight="120%" lineThrough="false" locale="en" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" renderingMode="cff" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="start" textJustify="interWord" trackingLeft="0" trackingRight="00" typographicCase="default" verticalAlign="top" />
Default MXML Propertytext
More examples
Related API Elements
Method | Defined By | ||
---|---|---|---|
Label()
Constructor. | Label | ||
Adds a child DisplayObject instance to this DisplayObjectContainer instance. | DisplayObjectContainer | ||
Adds a child DisplayObject instance to this DisplayObjectContainer
instance. | DisplayObjectContainer | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Adds a non-visual style client to this component instance. | UIComponent | ||
Indicates whether the security restrictions
would cause any display objects to be omitted from the list returned by calling
the DisplayObjectContainer.getObjectsUnderPoint() method
with the specified point point. | DisplayObjectContainer | ||
Queues a function to be called later. | UIComponent | ||
Deletes a style property from this component instance. | UIComponent | ||
Determines whether the specified display object is a child of the DisplayObjectContainer instance or
the instance itself. | DisplayObjectContainer | ||
Converts a Point object from content coordinates to global coordinates. | UIComponent | ||
Converts a Point object from content to local coordinates. | UIComponent | ||
Returns a set of properties that identify the child within
this container. | UIComponent | ||
Returns a set of properties that identify the child within
this container. | UIComponent | ||
Creates an id reference to this IUIComponent object
on its parent document object. | UIComponent | ||
Deletes the id reference to this IUIComponent object
on its parent document object. | UIComponent | ||
Returns a UITextFormat object corresponding to the text styles
for this UIComponent. | UIComponent | ||
[override]
Dispatches an event into the event flow. | UIComponent | ||
Shows or hides the focus indicator around this component. | UIComponent | ||
drawRoundRect(x:Number, y:Number, w:Number, h:Number, r:Object = null, c:Object = null, alpha:Object = null, rot:Object = null, gradient:String = null, ratios:Array = null, hole:Object = null):void
Programmatically draws a rectangle into this skin's Graphics object. | UIComponent | ||
Called by the effect instance when it stops playing on the component. | UIComponent | ||
Called by the effect instance when it starts playing on the component. | UIComponent | ||
Ends all currently playing effects on the component. | UIComponent | ||
Executes all the bindings for which the UIComponent object is the destination. | UIComponent | ||
Called after printing is complete. | UIComponent | ||
Provides the automation object at the specified index. | UIComponent | ||
Provides the automation object list . | UIComponent | ||
Returns a rectangle that defines the area of the display object relative to the coordinate system
of the targetCoordinateSpace object. | DisplayObject | ||
Returns the x coordinate of the element's bounds at the specified element size. | UIComponent | ||
Returns the y coordinate of the element's bounds at the specified element size. | UIComponent | ||
Returns the child display object instance that exists at the specified index. | DisplayObjectContainer | ||
Returns the child display object that exists with the specified name. | DisplayObjectContainer | ||
Returns the index position of a child DisplayObject instance. | DisplayObjectContainer | ||
Finds the type selectors for this UIComponent instance. | UIComponent | ||
Returns a layout constraint value, which is the same as
getting the constraint style for this component. | UIComponent | ||
A convenience method for determining whether to use the
explicit or measured height
| UIComponent | ||
A convenience method for determining whether to use the
explicit or measured width
| UIComponent | ||
Gets the object that currently has focus. | UIComponent | ||
Returns the element's layout height. | UIComponent | ||
Returns the element's layout width. | UIComponent | ||
Returns the x coordinate that the element uses to draw on screen. | UIComponent | ||
Returns the y coordinate that the element uses to draw on screen. | UIComponent | ||
Returns the transform matrix that is used to calculate the component's
layout relative to its siblings. | UIComponent | ||
Returns the layout transform Matrix3D for this element. | UIComponent | ||
Returns the element's maximum height. | UIComponent | ||
Returns the element's maximum width. | UIComponent | ||
Returns the element's minimum height. | UIComponent | ||
Returns the element's minimum width. | UIComponent | ||
Returns an array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance. | DisplayObjectContainer | ||
Returns the element's preferred height. | UIComponent | ||
Returns the element's preferred width. | UIComponent | ||
Returns a rectangle that defines the boundary of the display object,
based on the coordinate system defined by the targetCoordinateSpace
parameter, excluding any strokes on shapes. | DisplayObject | ||
Returns the item in the dataProvider that was used
by the specified Repeater to produce this Repeater, or
null if this Repeater isn't repeated. | UIComponent | ||
Gets a style property that has been set anywhere in this
component's style lookup chain. | UIComponent | ||
Converts a Point object from global to content coordinates. | UIComponent | ||
Converts the point object from the Stage (global) coordinates
to the display object's (local) coordinates. | DisplayObject | ||
Converts a two-dimensional point from the Stage (global) coordinates to a
three-dimensional display object's (local) coordinates. | DisplayObject | ||
Returns true if currentCSSState is not null. | UIComponent | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Determines whether the specified state has been defined on this
UIComponent. | UIComponent | ||
Evaluates the bounding box of the display object to see if it overlaps or intersects with the
bounding box of the obj display object. | DisplayObject | ||
Evaluates the display object to see if it overlaps or intersects with the
point specified by the x and y parameters. | DisplayObject | ||
Returns a box Matrix which can be passed to the
drawRoundRect() method
as the rot parameter when drawing a horizontal gradient. | UIComponent | ||
Initializes the internal structure of this component. | UIComponent | ||
Initializes various properties which keep track of repeated instances
of this component. | UIComponent | ||
Marks a component so that its updateDisplayList()
method gets called during a later screen update. | UIComponent | ||
Called by a component's items to indicate that their depth
property has changed. | UIComponent | ||
An element must call this method when its layoutDirection changes or
when its parent's layoutDirection changes. | UIComponent | ||
Marks a component so that its commitProperties()
method gets called during a later screen update. | UIComponent | ||
Marks a component so that its measure()
method gets called during a later screen update. | UIComponent | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Converts a three-dimensional point of the three-dimensional display
object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates. | DisplayObject | ||
Converts a Point object from local to content coordinates. | UIComponent | ||
Converts the point object from the display object's (local) coordinates to the
Stage (global) coordinates. | DisplayObject | ||
Returns true if cssState matches currentCSSState. | UIComponent | ||
Determines whether this instance is the same as, or is a subclass of,
the given type. | UIComponent | ||
Measures the specified HTML text, which can contain HTML tags such
as <font> and <b>,
assuming that it is displayed
in a single-line UITextField using a UITextFormat
determined by the styles of this UIComponent. | UIComponent | ||
Measures the specified text, assuming that it is displayed
in a single-line UITextField (or UIFTETextField) using a UITextFormat
determined by the styles of this UIComponent. | UIComponent | ||
Moves the component to a specified position within its parent. | UIComponent | ||
Propagates style changes to the children. | UIComponent | ||
Returns true if the chain of owner properties
points from child to this UIComponent. | UIComponent | ||
Called by Flex when a UIComponent object is added to or removed from a parent. | UIComponent | ||
Prepares an IFlexDisplayObject for printing. | UIComponent | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Builds or rebuilds the CSS style cache for this component
and, if the recursive parameter is true,
for all descendants of this component as well. | UIComponent | ||
For each effect event, registers the EffectManager
as one of the event listeners. | UIComponent | ||
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. | DisplayObjectContainer | ||
Removes a child DisplayObject from the specified index position in the child list of
the DisplayObjectContainer. | DisplayObjectContainer | ||
Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance. | DisplayObjectContainer | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Removes a non-visual style client from this component instance. | UIComponent | ||
Replays the specified event. | UIComponent | ||
Raises a virtual keyboard. | InteractiveObject | ||
Resolves a child by using the id provided. | UIComponent | ||
[static]
Resumes the background processing of methods
queued by callLater(), after a call to
suspendBackgroundProcessing(). | UIComponent | ||
Sizes the object. | UIComponent | ||
Changes the position of an existing child in the display object container. | DisplayObjectContainer | ||
Sets a layout constraint value, which is the same as
setting the constraint style for this component. | UIComponent | ||
Set the current state. | UIComponent | ||
Sets the focus to this component. | UIComponent | ||
Sets the coordinates that the element uses to draw on screen. | UIComponent | ||
Sets the layout size of the element. | UIComponent | ||
Sets the transform Matrix that is used to calculate the component's layout
size and position relative to its siblings. | UIComponent | ||
Sets the transform Matrix3D that is used to calculate the component's layout
size and position relative to its siblings. | UIComponent | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Sets a style property on this component instance. | UIComponent | ||
Called when the visible property changes. | UIComponent | ||
Lets the user drag the specified sprite. | Sprite | ||
Lets the user drag the specified sprite on a touch-enabled device. | Sprite | ||
Recursively stops the timeline execution of all MovieClips rooted at this object. | DisplayObjectContainer | ||
Ends the startDrag() method. | Sprite | ||
Ends the startTouchDrag() method, for use with touch-enabled devices. | Sprite | ||
Detects changes to style properties. | UIComponent | ||
Flex calls the stylesInitialized() method when
the styles for a component are first initialized. | UIComponent | ||
[static]
Blocks the background processing of methods
queued by callLater(),
until resumeBackgroundProcessing() is called. | UIComponent | ||
Swaps the z-order (front-to-back order) of the two specified child objects. | DisplayObjectContainer | ||
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the
child list. | DisplayObjectContainer | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
[override]
Returns a string indicating the location of this object
within the hierarchy of DisplayObjects in the Application. | FlexSprite | ||
transformAround(transformCenter:Vector3D, scale:Vector3D = null, rotation:Vector3D = null, translation:Vector3D = null, postLayoutScale:Vector3D = null, postLayoutRotation:Vector3D = null, postLayoutTranslation:Vector3D = null, invalidateLayout:Boolean = true):void
A utility method to update the rotation, scale, and translation of the
transform while keeping a particular point, specified in the component's
own coordinate space, fixed in the parent's coordinate space. | UIComponent | ||
A utility method to transform a point specified in the local
coordinates of this object to its location in the object's parent's
coordinates. | UIComponent | ||
Validates the position and size of children and draws other
visuals. | UIComponent | ||
Validate and update the properties and layout of this object
and redraw it, if necessary. | UIComponent | ||
Used by layout logic to validate the properties of a component
by calling the commitProperties() method. | UIComponent | ||
Validates the measured size of the component
If the LayoutManager.invalidateSize() method is called with
this ILayoutManagerClient, then the validateSize() method
is called when it's time to do measurements. | UIComponent | ||
Handles both the valid and invalid events from a
validator assigned to this component. | UIComponent | ||
Returns the primitive value of the specified object. | Object | ||
Returns a box Matrix which can be passed to drawRoundRect()
as the rot parameter when drawing a vertical gradient. | UIComponent | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Styles are either common or associated with a specific theme. If the style is common, it can be used with any theme. If a style is associated with a specific theme, it can only be used if your application uses that theme.
Style | Description | Defined By | ||
---|---|---|---|---|
alignmentBaseline | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Specifies the baseline to which the dominant baseline aligns. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.alignmentBaseline For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: Number CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The alpha level of the color defined by the backgroundColor style. | TextBase | |||
Type: uint Format: Color CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The color of the background of the entire bounding rectangle of this component. | TextBase | |||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The vertical distance in pixels from the top edge of the content area to the control's baseline position. | UIComponent | |||
baselineShift | Type: Object CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Amount to shift the baseline. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.baselineShift. For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The vertical distance, in pixels, from the bottom edge of the component to the bottom edge of its parent container's content area. | UIComponent | |||
cffHinting | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The type of CFF hinting used for this text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.cffHinting. For the Mobile theme, this is not supported. Related API Elements | Label | ||
color | Type: uint Format: Color CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Color of the text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.color. For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style color, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style color. The default value is 0x000000 .Related API Elements | Label | ||
digitCase | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The type of digit case used for this text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.digitCase. For the Mobile theme, this is not supported. Related API Elements | Label | ||
digitWidth | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Type of digit width used for this text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.digitWidth. For the Mobile theme, this is not supported. Related API Elements | Label | ||
direction | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Specifies the default bidirectional embedding level of the text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.direction. For the Mobile theme, this is not supported. Related API Elements | Label | ||
dominantBaseline | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Specifies which element baseline snaps to the alignmentBaseline to
determine the vertical position of the element on the line.
For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.dominantBaseline. For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: uint Format: Color CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 Color of the component highlight when validation fails. | UIComponent | |||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 Blend mode used by the focus rectangle. | UIComponent | |||
Type: Class CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 Skin used to draw the focus rectangle. | UIComponent | |||
Type: Number Format: Length CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 Thickness, in pixels, of the focus rectangle outline. | UIComponent | |||
fontFamily | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The name of the font to use, or a comma-separated list of font names. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontFamily. For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontFamily, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontFamily. The default value for the Spark theme is Related API Elements | Label | ||
fontLookup | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Font lookup to use. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontLookup For the Mobile theme, this is not supported. Related API Elements | Label | ||
fontSize | Type: Number Format: Length CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Height of the text, in pixels. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontSize For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontSize, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontSize. The default value for the Spark theme is Related API Elements | Label | ||
fontStyle | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Determines whether the text is italic font. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontStyle For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontStyle, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontStyle. Related API Elements | Label | ||
fontWeight | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Determines whether the text is boldface. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontWeight For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontWeight, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontWeight. Related API Elements | Label | ||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The horizontal distance in pixels from the center of the component's content area to the center of the component. | UIComponent | |||
Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4.5 Runtime Versions: Flash10, AIR 2.5 The primary interaction mode for this component. | UIComponent | |||
justificationRule | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Rule used to justify text in a paragraph. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.justificationRule For the Mobile theme, this is not supported. Related API Elements | Label | ||
justificationStyle | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The style used for justification of the paragraph. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.justificationStyle For the Mobile theme, this is not supported. Related API Elements | Label | ||
kerning | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The style used for justification of the paragraph. Kerning is enabled by default for Spark components, but is disabled by default for MX components.
Spark components interpret For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.kerning For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4.1 Runtime Versions: Flash10, AIR 1.5 Specifies the desired layout direction of a component. | UIComponent | |||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The horizontal distance, in pixels, from the left edge of the component to the left edge of its parent container's content area. | UIComponent | |||
ligatureLevel | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Controls which of the ligatures that are defined in the font may be used in the text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.ligatureLevel For the Mobile theme, this is not supported. Related API Elements | Label | ||
lineBreak | Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Controls word wrapping within the container. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.blockProgression. For the Mobile theme, this is not supported. Related API Elements | Label | ||
lineHeight | Type: Object CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Leading controls for the text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.lineHeight.
For the Mobile theme, this is not supported. See Related API Elements | Label | ||
lineThrough | Type: Boolean CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 If true, applies strikethrough, a line drawn through the middle of the text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.lineThrough For the Mobile theme, this is not supported. Related API Elements | Label | ||
locale | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The locale of the text. Controls case transformations and shaping. Uses standard locale identifiers as described in Unicode Technical Standard #35. For example "en", "en_US" and "en-US" are all English, "ja" is Japanese. The default value is undefined. This property inherits its value from an ancestor; if
still undefined, it inherits from the global When using the Spark formatters and globalization classes, you can set this style on the
root application to the value of the undefined .Learn more | Label | ||
paddingBottom | Type: Number Format: Length CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Bottom inset, in pixels. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.paddingBottom. For the Mobile theme, this is not supported. Related API Elements | Label | ||
paddingLeft | Type: Number Format: Length CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Left inset, in pixels. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.paddingLeft. For the Mobile theme, this is not supported. Related API Elements | Label | ||
paddingRight | Type: Number Format: Length CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Right inset, in pixels. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.paddingRight. For the Mobile theme, this is not supported. Related API Elements | Label | ||
paddingTop | Type: Number Format: Length CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Top inset, in pixels. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.paddingRight. For the Mobile theme, this is not supported. Related API Elements | Label | ||
renderingMode | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The rendering mode used for this text which applies only to embedded fonts. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.renderingMode For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The horizontal distance, in pixels, from the right edge of the component to the right edge of its parent container's content area. | UIComponent | |||
Type: Boolean CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4.5 Runtime Versions: Flash10, AIR 1.5 Show the error border or skin when this component is invalid | UIComponent | |||
Type: Boolean CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4.5 Runtime Versions: Flash10, AIR 1.5 Show the error tip when this component is invalid and the user rolls over it | UIComponent | |||
textAlign | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Alignment of text within a container. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textAlign For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style textAlign, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style textAlign. Related API Elements | Label | ||
textAlignLast | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Alignment of the last line in the paragraph relative to the container in justified text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textAlignLast For the Mobile theme, this is not supported. Related API Elements | Label | ||
textAlpha | Type: Number CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Alpha (transparency) value for the text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textAlpha For the Mobile theme, this is not supported. Related API Elements | Label | ||
textDecoration | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Determines whether the text is underlined. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textDecoration For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style textDecoration, and if using StyleableStageText, this is not supported. Related API Elements | Label | ||
textJustify | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Specifies options for justifying text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textJustify For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The vertical distance, in pixels, from the top edge of the component to the top edge of its parent container's content area. | UIComponent | |||
trackingLeft | Type: Object CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The amount of tracking (manual kerning) to be applied to the left of each character. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.trackingLeft For the Mobile theme, this is not supported. Related API Elements | Label | ||
trackingRight | Type: Object CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The amount of tracking (manual kerning) to be applied to the right of each character. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.trackingRight For the Mobile theme, this is not supported. Related API Elements | Label | ||
typographicCase | Type: String CSS Inheritance: Yes Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 The type of typographic case used for this text. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.typographicCase For the Mobile theme, this is not supported. Related API Elements | Label | ||
verticalAlign | Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 4 Runtime Versions: Flash10, AIR 1.5 Vertical alignment or justification. For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.verticalAlign. For the Mobile theme, this is not supported. Related API Elements | Label | ||
Type: String CSS Inheritance: No Language Version: ActionScript 3.0 Product Version: Flex 3 Runtime Versions: Flash9, AIR 1.1 The vertical distance in pixels from the center of the component's content area to the center of the component. | UIComponent |
Style | Description | Defined By | ||
---|---|---|---|---|
leading | Type: Number Format: Length CSS Inheritance: Yes Theme: mobile Language Version: ActionScript 3.0 Product Version: Flex 4.5 Runtime Versions: Flash10.1, AIR 2.0 Additional vertical space between lines of text.
For the Spark theme, this is not supported. See For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableStageText Style fontWeight and if using StyleableStageText, this is not supported. Related API Elements | Label | ||
letterSpacing | Type: Number CSS Inheritance: Yes Theme: mobile Language Version: ActionScript 3.0 Product Version: Flex 4.5 Runtime Versions: Flash10.1, AIR 2.0 The number of additional pixels to appear between each character.
For the Spark theme, this is not supported. See For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField.letterSpacing and if using StyleableStageText, this is not supported. Related API Elements | Label |
Label | () | Constructor |
public function Label()
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Constructor.
<?xml version="1.0" encoding="utf-8"?> <!-- LabelExample.mxml --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <s:Panel title="Label Example" width="75%" height="75%" horizontalCenter="0" verticalCenter="0"> <s:Group left="10" right="10" top="10" bottom="10"> <s:Label x="0" y="0" height="75" width="75"> <s:text>This is a Label control.</s:text> </s:Label> <s:Group x="100" y="0"> <s:Label height="100" width="75" paddingTop="5" paddingLeft="5" paddingRight="5" paddingBottom="5"> <s:text>This is a Spark Label control with a border drawn by a Rect.</s:text> </s:Label> <s:Rect width="100%" height="100%"> <s:stroke> <s:SolidColorStroke color="red"/> </s:stroke> </s:Rect> </s:Group> </s:Group> </s:Panel> </s:Application>
Wed Nov 21 2018, 06:34 AM -08:00