flashx.textLayout.edit

# TextClipboard - AS3

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.

Related API Elements

flash.desktop.Clipboard

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

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | getContents():flashx.textLayout.edit:TextScrap [static] Gets any text on the system clipboard as a TextScrap object. | TextClipboard
|  | 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
|  | setContents(textScrap:flashx.textLayout.edit:TextScrap):void [static] Puts a TextScrap onto the system clipboard. | TextClipboard
|  | 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

Method Detail

### getContents

()
method

`public static function getContents():flashx.textLayout.edit: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

| `flashx.textLayout.edit:TextScrap`

Related API Elements

flash.events.Event.PASTE

### setContents

()
method

`public static function setContents(textScrap:flashx.textLayout.edit: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:flashx.textLayout.edit:TextScrap` — The TextScrap to paste into the clipboard.

Related API Elements

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

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