This section describes extensions for selection and clipboard operations.
alwaysShowSelection property
alwaysShowSelection:Boolean [read-write]
Scaleform version: 2.1.45
By default, if the text field is not in focus, Scaleform does not highlight the selection. When this property is set to true and the text field is not in focus, Scaleform highlights the selection in the text field in gray. Colors of active and inactive selection might be overridden.
The default value is false.
See also:
selectionBkgColor selectionTextColor inactiveSelectionBkgColor inactiveSelectionTextColor
copyToClipboard () method
public function copyToClipboard([richClipboard:Boolean], [startIndex:Number], [endIndex:Number]):void
Scaleform version: 2.1.45
The method copies the text to clipboard. All parameters are optional.
Parameters
richClipboard:Boolean – If the value is true then text with styles will be copied to the clipboard. Default value is equal to the useRichTextClipboard property.
startIndex:Number – Start index of text segment being copied. Default value is equal to selectionBeginIndex.
endIndex:Number – End index of text segment being copied. Default value is equal to selectionEndIndex.
See also: useRichTextClipboard selectionBeginIndex selectionEndIndex cutToClipboard() pasteFromClipboard()
cutToClipboard () method
public function cutToClipboard([richClipboard:Boolean], [startIndex:Number], [endIndex:Number]):void
Scaleform version: 2.1.45
The method copies the text to clipboard and removes it from the text field. All parameters are optional.
Parameters
richClipboard:Boolean – If true then text with styles will be copied to the clipboard. Default value is equal to the useRichTextClipboard property.
startIndex:Number – Start index of text segment being copied. Default value is equal to selectionBeginIndex.
endIndex:Number – End index of text segment being copied. Default value is equal to selectionEndIndex.
See also: useRichTextClipboard selectionBeginIndex selectionEndIndex copyToClipboard() pasteFromClipboard()
inactiveSelectionBkgColor property
inactiveSelectionBkgColor:Number [read-write]
Scaleform version: 2.1.45
Specifies the background color of the inactive selection. It is actual only if the alwaysShowSelection property is set to true. The color is specified in the following format: 0xAARRGGBB, in which AA is the hexadecimal representation of the alpha channel component [0...255], RR is the hexadecimal representation of the red component [0...255], BB is the hexadecimal representation of the blue component [0...255] and GG is the hexadecimal representation of the green component [0...255]. Note, make sure the alpha channel is not set to 0, because in this case nothing will be drawn (since alpha set to 0 means complete transparency). Thus, this color is a little bit different from the regular colors used in Flash for a background color. For example, to set this property to full intense red color it is necessary to use the value 0xFFFF0000 (alpha and red set to 0xFF (255)), but for regular “backgroundColor” property it is enough to use the value 0xFF0000.
See also: alwaysShowSelection inactiveSelectionTextColor selectionBkgColor selectionTextColor
inactiveSelectionTextColor property
inactiveSelectionTextColor:Number [read-write]
Scaleform version: 2.1.45
Specifies the text color of inactive selection. It is actual only if the alwaysShowSelection property is set to true. The color is specified in the following format: 0xAARRGGBB, in which AA is the hexadecimal representation of the alpha channel component [0...255], RR is the hexadecimal representation of the red component [0...255], BB is the hexadecimal representation of the blue component [0...255] and GG is the hexadecimal representation of the green component [0...255].
Note: make sure the alpha channel is not set to 0, because in this case nothing will be drawn (since alpha set to 0 means complete transparency). Thus, this color is a little bit different from the regular colors used in Flash for text color. For example, to set this property to full intense red color it is necessary to use the value 0xFFFF0000 (alpha and red set to 0xFF (255)), but for regular “textColor” property it is enough to use the value 0xFF0000.
See also:
alwaysShowSelection inactiveSelectionBkgColor selectionBkgColor selectionTextColor
noAutoSelection property
noAutoSelection:Boolean [read-write]
Scaleform version: 2.1.45
If set to true, prevents auto selection when focus is transferred to a text field.
The default value is false.
pasteFromClipboard () method
public function pasteFromClipboard([richClipboard:Boolean], [startIndex:Number], [endIndex:Number]):void
Scaleform version: 2.1.45
The method pastes the text from the clipboard. All parameters are optional.
Parameters
richClipboard:Boolean – If true then text with styles will be pasted from the clipboard. Default value is equal to useRichTextClipboard property.
startIndex:Number – Start index of the segment being replaced by the text from the clipboard. Default value is equal to selectionBeginIndex.
endIndex:Number – End index of the segment being replaced by the text from the clipboard. Default value is equal to selectionEndIndex.
See also: useRichTextClipboard selectionBeginIndex selectionEndIndex copyToClipboard() cutToClipboard()
selectionBeginIndex property
selectionBeginIndex:Number [read-only]
Scaleform version: 2.1.45
This property represents the zero-based character index value of the first character in the current selection. If no text is selected, this property is the value of caretIndex. This property contains the same value as the method Selection.getBeginIndex() returns; though, the selectionBeginIndex is accessible even if the text field is not focused, whereas the Selection.getBeginIndex() returns -1 in this case. See also:
caretIndex selectionEndIndex Selection.getBeginIndex()
selectionEndIndex property
selectionEndIndex:Number [read-only]
Scaleform version: 2.1.45
This property represents the zero-based character index value of the last character in the current selection. If no text is selected, this property is the value of caretIndex. This property contains the same value as the method Selection.getEndIndex() returns; though, the selectionEndIndex is accessible even if the text field is not focused, whereas the Selection.getEndIndex() returns -1 in this case. See also:
caretIndex selectionBeginIndex Selection.getEndIndex()
selectionBkgColor property
selectionBkgColor:Number [read-write]
Scaleform version: 2.1.45
Specifies the background color of the active selection. The color is specified in the following format: 0xAARRGGBB, in which AA is the hexadecimal representation of the alpha channel component [0..255], RR the hexadecimal representation of the red component [0..255], BB the hexadecimal representation of the blue component [0..255] and GG the hexadecimal representation of the green component [0..255]. Note: make sure the alpha channel is not set to 0, because in this case nothing will be drawn (since alpha set to 0 indicates complete transparency). Thus, this color is a little bit different from the regular colors used in Flash for background color. For example, to set this property to full intense red color it is necessary to use the value 0xFFFF0000 (alpha and red set to 0xFF (255)), but for the regular BkgColor property it is enough to use the value 0xFF0000. See also:
inactiveSelectionTextColor inactiveSelectionBkgColor selectionTextColor
selectionTextColor property
selectionTextColor:Number [read-write]
Scaleform version: 2.1.45
Specifies the text color of the active selection. The color is specified in the following format: 0xAARRGGBB, in which AA is the hexadecimal representation of the alpha channel component [0..255], RR the hexadecimal representation of the red component [0..255], BB the hexadecimal representation of the blue component [0..255] and GG the hexadecimal representation of the green component [0..255].
Note: make sure the alpha channel is not set to 0, because in this case nothing will be drawn (since alpha set to 0 indicates complete transparency). Thus, this color is a little bit different from the regular colors used in Flash for text color. For example, to set this property to full intense red color it is necessary to use the value 0xFFFF0000 (alpha and red set to 0xFF (255)), but for regular textColor property it is enough to use the value 0xFF0000. See also:
inactiveSelectionBkgColor inactiveSelectionBkgColor selectionBkgColor
useRichTextClipboard property
useRichTextClipboard:Boolean [read-write]
Scaleform version: 2.1.45
Specifies whether to copy and paste the text formatting along with the text. When set to true, Scaleform will also copy and paste formatting (e.g., alignment, bold and italics) when you copy and paste between text fields. Both the origin and destination text fields for the copy and paste procedure must have useRichTextClipboard set to true.
The default value is false.