Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
TextClipboard

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

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The TextClipboard class copies and pastes TextScrap objects to and from the system clipboard.

When you copy a TextScrap to the TextClipboard, the information is copied to the system clipboard in two clipboard formats. One format is an XML string expressing the copied TextScrap object in Text Layout Markup syntax. This clipboard object uses the format name: "TEXT_LAYOUT_MARKUP". The second format is a plain-text string, which uses the standard Clipboard.TEXT_FORMAT name.

The methods of the TextClipboard class are static functions, you do not need to create an instance of TextClipboard.

See also

flash.desktop.Clipboard

Public Methods

| Method | Defined By
--- | --- | ---
|  | getContents():TextScrap [static] Gets any text on the system clipboard as a TextScrap object. | TextClipboard
|  | setContents(textScrap:TextScrap):void [static] Puts a TextScrap onto the system clipboard. | TextClipboard

Method Detail

getContents | () | method

`public static function getContents():TextScrap`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Gets any text on the system clipboard as a TextScrap object.

If the "TEXT_LAYOUT_MARKUP" format is available, this method converts the formatted string into a TextScrap and returns it. Otherwise, if the Clipboard.TEXT_Format is available, this method converts the plain-text string into a TextScrap. If neither clipboard format is available, this method returns `null`.

Flash Player requires that the `getContents()` method be called in a paste event handler. In AIR, this restriction only applies to content outside of the application security sandbox.

Returns

| `TextScrap`

See also

flash.events.Event.PASTE

setContents | () | method |

`public static function setContents(textScrap:TextScrap):void`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Puts a TextScrap onto the system clipboard.

The TextScrap is placed onto the system clipboard as both a Text Layout Markup representation and a plain text representation.

Flash Player requires a user event (such as a key press or mouse click) before calling `setContents()`. In AIR, this restriction only applies to content outside of the application security sandbox.

Parameters

| `textScrap:TextScrap` — The TextScrap to paste into the clipboard.

See also

flash.events.Event.COPY
flash.events.Event.CUT

Wed Nov 15 2017, 09:50 AM +01:00