DepthManager

Kind of class:class
Inherits from:none
Classpath:mx.managers.DepthManager
File last modified:Tuesday, 18 December 2007, 15:44:38
Class for managing the depth (z-order) of objects.

Summary


Constructor
Class properties
Instance properties
Class methods
  • sortFunction (a:MovieClip, b:MovieClip) : Number
  • test (depth:Number) : Boolean
  • createClassObjectAtDepth (className:Object, depthSpace:Number, initObj:Object) : UIObject
    • create an instance of a class at a depth relative to other content
  • createObjectAtDepth (linkageName:String, depthSpace:Number, initObj:Object) : MovieClip
    • create an instance of a symbol at a depth relative to other content
Instance methods
  • createClassChildAtDepth (className:Function, depthFlag:Number, initObj:Object) : UIObject
    • create an instance of a class at a depth relative to other content
  • createChildAtDepth (linkageName:String, depthFlag:Number, initObj:Object) : MovieClip
    • create an instance of a symbol at a depth relative to other content
  • setDepthTo (depthFlag:Number) : Void
    • set this object at a particular depth, moving other objects to make room if needed
  • setDepthAbove (targetInstance:MovieClip) : Void
    • set this object above the target object, moving other objects including the target object to make room if needed
  • setDepthBelow (targetInstance:MovieClip) : Void
    • set this object below the target object, moving other objects including the target object to make room if needed
  • findNextAvailableDepth (targetDepth:Number, depthTable:Array, direction:String) : Number
  • shuffleDepths (subject:MovieClip, targetDepth:Number, depthTable:Array, direction:String) : Void
  • getDepthByFlag (depthFlag:Number, depthTable:Array) : Number
  • buildDepthTable (Void) : Array

Constructor

DepthManager

function DepthManager (
)

Class properties

__depthManager

static __depthManager:DepthManager = new DepthManager()
(read)

highestDepth

static highestDepth:Number = 1048574
(read)

holder

static private holder:MovieClip = _root.createEmptyMovieClip("reserved", DepthManager.reservedDepth)
(read)

kBottom

static kBottom:Number = 202
(read)

constant used in calls to createClassChildtAtDepth/createChildAtDepth

kCursor

static kCursor:Number = 101
(read)

constant used in calls to createClassObjectAtDepth/createObjectAtDepth

kNotopmost

static kNotopmost:Number = 204
(read)

constant used in calls to createClassChildtAtDepth/createChildAtDepth

kTooltip

static kTooltip:Number = 102
(read)

constant used in calls to createClassObjectAtDepth/createObjectAtDepth

kTop

static kTop:Number = 201
(read)

constant used in calls to createClassChildtAtDepth/createChildAtDepth

kTopmost

static kTopmost:Number = 203
(read)

constant used in calls to createClassChildtAtDepth/createChildAtDepth

lowestDepth

static lowestDepth:Number = -16383
(read)

numberOfAuthortimeLayers

static numberOfAuthortimeLayers:Number = 383
(read)

reservedDepth

static reservedDepth:Number = 1048575
(read)

Instance properties

_childCounter

_childCounter:Number
(read)

_parent

_parent:MovieClip
(read)

_topmost

_topmost:Boolean
(read)

createClassObject

createClassObject:Function
(read)

createObject

createObject:Function
(read)

getDepth

getDepth:Function
(read)

swapDepths

swapDepths:Function
(read)

Class methods

createClassObjectAtDepth

static function createClassObjectAtDepth (
className:Object, depthSpace:Number, initObj:Object) : UIObject

create an instance of a class at a depth relative to other content
Parameters:
className :
the name of the class
depthSpace:
either kCursor or kTooltip
initObj :
object containing initialization properties
Returns:
  • reference to object

createObjectAtDepth

static function createObjectAtDepth (
linkageName:String, depthSpace:Number, initObj:Object) : MovieClip

create an instance of a symbol at a depth relative to other content
Parameters:
linkageName:
the linkage name of the symbol in the library
depthSpace :
either kCursor or kTooltip
initObj :
object containing initialization properties
Returns:
  • reference to object

sortFunction

static function sortFunction (
a:MovieClip, b:MovieClip) : Number

test

static function test (
depth:Number) : Boolean

Instance methods

buildDepthTable

function buildDepthTable (
Void) : Array

Returns:
  • Array a table of the depths of the child objects

createChildAtDepth

function createChildAtDepth (
linkageName:String, depthFlag:Number, initObj:Object) : MovieClip

create an instance of a symbol at a depth relative to other content
Parameters:
linkageName:
the linkage name of the symbol in the library
depthSpace :
one of kTop, kBottom, kTopmost, kNoTopmost
initObj :
object containing initialization properties
Returns:
  • reference to object

createClassChildAtDepth

function createClassChildAtDepth (
className:Function, depthFlag:Number, initObj:Object) : UIObject

create an instance of a class at a depth relative to other content
Parameters:
className :
the name of the class
depthSpace:
one of kTop, kBottom, kTopmost, kNoTopmost
initObj :
object containing initialization properties
Returns:
  • reference to object

findNextAvailableDepth

function findNextAvailableDepth (
targetDepth:Number, depthTable:Array, direction:String) : Number

Parameters:
targetDepth:
desired depth
depthTable :
generated by call to buildDepthTable
direction :
"up" - look up if something occupies that depth, or "down"
Returns:
  • Number next available depth

getDepthByFlag

function getDepthByFlag (
depthFlag:Number, depthTable:Array) : Number

Parameters:
depthFlag :
either kTop, kBotton, kTopmost or kNoTopmost
depthTable:
generated by call to buildDepthTable
Returns:
  • Number a good depth to start with

setDepthAbove

function setDepthAbove (
targetInstance:MovieClip) : Void

set this object above the target object, moving other objects including the target object to make room if needed
Parameters:
targetInstance:
the target object

setDepthBelow

function setDepthBelow (
targetInstance:MovieClip) : Void

set this object below the target object, moving other objects including the target object to make room if needed
Parameters:
targetInstance:
the target object

setDepthTo

function setDepthTo (
depthFlag:Number) : Void

set this object at a particular depth, moving other objects to make room if needed
Parameters:
depthFlag:
the desired depth

shuffleDepths

function shuffleDepths (
subject:MovieClip, targetDepth:Number, depthTable:Array, direction:String) : Void

Parameters:
subject :
the object we want to move
targetDepth:
desired depth
depthTable :
generated by call to buildDepthTable
direction :
"up" - look up if something occupies that depth, or "down" or undefined - use best judgement