flashx.textLayout.edit

# SelectionFormat - AS3

Package | flashx.textLayout.edit
Class | public class SelectionFormat
Inheritance | SelectionFormat Object

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The SelectionFormat class defines the properties of a selection highlight.

More examples

Styling TLF-based text controls

Related API Elements

flashx.textLayout.edit.ISelectionManager
flashx.textLayout.edit.SelectionManager

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | pointAlpha : Number [read-only] The alpha for drawing the cursor. | SelectionFormat
|  | pointBlendMode : String [read-only] The blend mode for drawing the cursor. | SelectionFormat
|  | pointBlinkRate : Number [read-only] The rate at which the cursor blinks, in milliseconds. | SelectionFormat
|  | pointColor : uint [read-only] The color for drawing the cursor. | SelectionFormat
|  | rangeAlpha : Number [read-only] The alpha for drawing the highlight of a range selection. | SelectionFormat
|  | rangeBlendMode : String [read-only] The blending mode for drawing the highlight of a range selection. | SelectionFormat
|  | rangeColor : uint [read-only] The color for drawing the highlight of a range selection. | SelectionFormat

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | SelectionFormat(rangeColor:uint = 0xffffff, rangeAlpha:Number = 1.0, rangeBlendMode:String = "difference", pointColor:uint = 0xffffff, pointAlpha:Number = 1.0, pointBlendMode:String = "difference", pointBlinkRate:Number = 500) Creates a SelectionFormat object with the specified properties. | SelectionFormat
|  | equals(selectionFormat:SelectionFormat):Boolean Determines whether this SelectionFormat object has the same property values as another SelectionFormat object. | SelectionFormat
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### pointAlpha

property

`pointAlpha:Number` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The alpha for drawing the cursor. Valid values are between 0 (completely transparent) and 1 (completely opaque, which is the default).

Setting the `pointAlpha` and `rangeAlpha` properties to zero disables selection highlighting.

Implementation
`public function get pointAlpha():Number`

Related API Elements

rangeAlpha

### pointBlendMode

property

`pointBlendMode:String` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The blend mode for drawing the cursor.

Implementation
`public function get pointBlendMode():String`

Related API Elements

flash.display.BlendMode

### pointBlinkRate

property

`pointBlinkRate:Number` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The rate at which the cursor blinks, in milliseconds.

Implementation
`public function get pointBlinkRate():Number`

### pointColor

property

`pointColor:uint` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The color for drawing the cursor.

Implementation
`public function get pointColor():uint`

### rangeAlpha

property

`rangeAlpha:Number` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The alpha for drawing the highlight of a range selection. Valid values are between 0 (completely transparent) and 1 (completely opaque, which is the default).

Setting the `pointAlpha` and `rangeAlpha` properties to zero disables selection highlighting.

Implementation
`public function get rangeAlpha():Number`

Related API Elements

pointAlpha

### rangeBlendMode

property

`rangeBlendMode:String` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The blending mode for drawing the highlight of a range selection.

Implementation
`public function get rangeBlendMode():String`

Related API Elements

flash.display.BlendMode

### rangeColor

property

`rangeColor:uint` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The color for drawing the highlight of a range selection.

Implementation
`public function get rangeColor():uint`
Constructor Detail

### SelectionFormat

()
Constructor

`public function SelectionFormat(rangeColor:uint = 0xffffff, rangeAlpha:Number = 1.0, rangeBlendMode:String = "difference", pointColor:uint = 0xffffff, pointAlpha:Number = 1.0, pointBlendMode:String = "difference", pointBlinkRate:Number = 500)`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a SelectionFormat object with the specified properties.

A SelectionFormat created with the default values will use black for the highlight colors, 1.0 for the alphas, and BlendMode.DIFFERENCE for the blending modes. The cursor blink rate is 500 milliseconds.

Setting the `pointAlpha` and `rangeAlpha` properties to zero disables selection highlighting.

Non-zero blink rate is only used when an EditManager is attached to the TextFlow.

Parameters

| `rangeColor:uint` (default = `0xffffff`)`` — The color for drawing the highlight.
| `rangeAlpha:Number` (default = `1.0`)`` — The transparency value for drawing the highlight. Valid values are between 0 (completely transparent) and 1 (completely opaque, which is the default).
| `rangeBlendMode:String` (default = "`difference`")`` — The blend mode for drawing the highlight. Use constants defined in the BlendMode class to set this parameter.
| `pointColor:uint` (default = `0xffffff`)`` — The color for the drawing cursor.
| `pointAlpha:Number` (default = `1.0`)`` — The transparency value for drawing the cursor. Valid values are between 0 (completely transparent) and 1 (completely opaque, which is the default).
| `pointBlendMode:String` (default = "`difference`")`` — The blend mode for drawing the cursor. Use constants defined in the BlendMode class to set this parameter.
| `pointBlinkRate:Number` (default = `500`)`` — The rate at which the cursor blinks, in milliseconds.

Related API Elements

flash.display.BlendMode
pointAlpha
rangeAlpha
Method Detail

### equals

()
method

`public function equals(selectionFormat:SelectionFormat):Boolean`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Determines whether this SelectionFormat object has the same property values as another SelectionFormat object.

Parameters

| `selectionFormat:SelectionFormat` — the SelectionFormat to compare against.

Returns

| `Boolean` — `true`, if the property values are identical; `false`, otherwise.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00