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

Package | spark.components.supportClasses
Class | public class DisplayLayer
Inheritance | DisplayLayer flash.events.EventDispatcher

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

A DisplayLayer class maintains an ordered list of DisplayObjects sorted on depth. You do not instantiate this class, but use the `overlay` property of `Group` and `DataGroup`.

See also

spark.components.Group.overlay
spark.components.DataGroup.overlay

Public Properties

| Property | Defined By
--- | --- | ---
|  | numDisplayObjects : int [read-only] Number of objects in the DisplayLayer. | DisplayLayer

Public Methods

| Method | Defined By
--- | --- | ---
|  | DisplayLayer() Constructor. | DisplayLayer
|  | addDisplayObject(displayObject:DisplayObject, depth:Number):DisplayObject Adds a displayObject with the specified depth to the ordered list. | DisplayLayer
|  | getDisplayObjectAt(index:int):DisplayObject Returns the DisplayObject with the specified index. | DisplayLayer
|  | getDisplayObjectDepth(displayObject:DisplayObject):Number Returns the depth for the specified DisplayObject. | DisplayLayer
|  | removeDisplayObject(displayObject:DisplayObject):DisplayObject Removes the specified displayObject from the sorted list. | DisplayLayer

Property Detail

numDisplayObjects | property

`numDisplayObjects:int` [read-only]

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Number of objects in the DisplayLayer.

Implementation
`public function get numDisplayObjects():int`
Constructor Detail

DisplayLayer | () | Constructor

`public function DisplayLayer()`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Constructor.

Method Detail

addDisplayObject | () | method

`public function addDisplayObject(displayObject:DisplayObject, depth:Number):DisplayObject`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Adds a `displayObject` with the specified depth to the ordered list. The position of the `displayObject` in the sorted lists is based on its depth. The object is inserted after all objects with less than or equal `depth` value.

Parameters

| `displayObject:DisplayObject` — The object to add.
| `depth:Number` (default = `NaN`)`` — The depth of the object.

Returns

| `DisplayObject` — The index of the object.

getDisplayObjectAt | () | method |

`public function getDisplayObjectAt(index:int):DisplayObject`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Returns the DisplayObject with the specified index.

Parameters

| `index:int` — The index of the object.

Returns

| `DisplayObject` — The object.

getDisplayObjectDepth | () | method |

`public function getDisplayObjectDepth(displayObject:DisplayObject):Number`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Returns the depth for the specified DisplayObject.

Parameters

| `displayObject:DisplayObject` — The object.

Returns

| `Number` — The depth of the object.

removeDisplayObject | () | method |

`public function removeDisplayObject(displayObject:DisplayObject):DisplayObject`

Language Version : | ActionScript 3.0

Product Version : | Flex 4

Runtime Versions : | Flash Player 10, AIR 1.5

Removes the specified `displayObject` from the sorted list.

Parameters

| `displayObject:DisplayObject` — The object.

Returns

| `DisplayObject` — The removed object.

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