flashx.textLayout.edit

# TextScrap - AS3

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

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The TextScrap class represents a fragment of a text flow.

A TextScrap is a holding place for all or part of a TextFlow. A range of text can be copied from a TextFlow into a TextScrap, and pasted from the TextScrap into another TextFlow.

Related API Elements

flashx.textLayout.elements.TextFlow
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
|  | textFlow : flashx.textLayout.elements:TextFlow [read-only] Gets the TextFlow that is currently in the TextScrap. | TextScrap

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | TextScrap(textFlow:flashx.textLayout.elements:TextFlow = null) Creates a TextScrap object. | TextScrap
|  | clone():flashx.textLayout.edit:TextScrap Creates a duplicate copy of this TextScrap object. | TextScrap
|  | createTextScrap(range:flashx.textLayout.elements:TextRange):flashx.textLayout.edit:TextScrap [static] Creates a TextScrap object from a range of text represented by a TextRange object. | TextScrap
|  | 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

### textFlow

property

`textFlow:flashx.textLayout.elements:TextFlow` [read-only]

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Gets the TextFlow that is currently in the TextScrap.

Implementation
`public function get textFlow():flashx.textLayout.elements:TextFlow`
Constructor Detail

### TextScrap

()
Constructor

`public function TextScrap(textFlow:flashx.textLayout.elements:TextFlow = null)`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a TextScrap object.

Use the `createTextScrap()` method to create a TextScrap object from a range of text represented by a TextRange object.

Parameters

| `textFlow:flashx.textLayout.elements:TextFlow` (default = `null`)`` — if set, the new TextScrap object contains the entire text flow. Otherwise, the TextScrap object is empty.

Method Detail

### clone

()
method

`public function clone():flashx.textLayout.edit:TextScrap`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a duplicate copy of this TextScrap object.

Returns

| `flashx.textLayout.edit:TextScrap` — TextScrap A copy of this TextScrap.

### createTextScrap

()
method

`public static function createTextScrap(range:flashx.textLayout.elements:TextRange):flashx.textLayout.edit:TextScrap`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a TextScrap object from a range of text represented by a TextRange object.

Parameters

| `range:flashx.textLayout.elements:TextRange` — the TextRange object representing the range of text to copy.

Returns

| `flashx.textLayout.edit:TextScrap`

### isPlainText

()
method

`tlf_internal function isPlainText():Boolean`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Returns true if the text is plain text (not formatted)

Returns

| `Boolean`

### setPlainText

()
method

`tlf_internal function setPlainText(plainText:Boolean):void`

Marks the TextScrap's content as being either plain or formatted

Parameters

| `plainText:Boolean`

Constant Detail

### MERGE_TO_NEXT_ON_PASTE

Constant

`tlf_internal static const MERGE_TO_NEXT_ON_PASTE:String = "mergeToNextOnPaste"`

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