Main Page | Packages | Class Tree | Index | Help

mx.managers

class DepthManager

Object
  |
  +--mx.managers.DepthManager


class DepthManager
extends Object

Class for managing the depth (z-order) of objects.



Field Summary

static
__depthManager: DepthManager
this technique guarantees that the depthManager is created and adds to the base class when this package is included in a SWF


_childCounter: Number
the rest of these methods are added to UIObject the methods use the following properties and methods on UIObject.


_parent: MovieClip



_topmost: Boolean



createClassObject: Function



createObject: Function



getDepth: Function


static
highestDepth: Number
highest depth for all other objects

static
kBottom: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

static
kCursor: Number
constant used in calls to createClassObjectAtDepth/createObjectAtDepth

static
kNotopmost: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

static
kTooltip: Number
constant used in calls to createClassObjectAtDepth/createObjectAtDepth

static
kTop: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

static
kTopmost: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

static
lowestDepth: Number
lowest allowed depth

static
numberOfAuthortimeLayers: Number
lowest depth plus this number of layers is reserved for statically placed content

static
reservedDepth: Number
highest allowed depth is reserved for tooltips and cursors


swapDepths: Function


Fields inherited from class Object

__proto__, constructor, prototype

Constructor


DepthManager ( )
Only one depth manager is needed.

Method Summary


buildDepthTable ( Void ): Array



createChildAtDepth ( linkageName: String, depthFlag: Number, initObj: Object ): MovieClip
create an instance of a symbol at a depth relative to other content


createClassChildAtDepth ( className: Function, depthFlag: Number, initObj: Object ): UIObject
create an instance of a class at a depth relative to other content

static
createClassObjectAtDepth ( className: Object, depthSpace: Number, initObj: Object ): UIObject
create an instance of a class at a depth relative to other content

static
createObjectAtDepth ( linkageName: String, depthSpace: Number, initObj: Object ): MovieClip
create an instance of a symbol at a depth relative to other content


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



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



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


setDepthTo ( depthFlag: Number ): Void
set this object at a particular depth, moving other objects to make room if needed


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


static
sortFunction ( a: MovieClip, b: MovieClip ): Number
sort the depths in the array of depths.

static
test ( depth: Number ): Boolean
true if it is the reserved depth

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toLocaleString, toString, unwatch, valueOf, watch



Field Documentation

__depthManager

static var __depthManager: DepthManager
this technique guarantees that the depthManager is created and adds to the base class when this package is included in a SWF

_childCounter

var _childCounter: Number
the rest of these methods are added to UIObject the methods use the following properties and methods on UIObject.

_parent

var _parent: MovieClip

_topmost

var _topmost: Boolean

createClassObject

var createClassObject: Function

createObject

var createObject: Function

getDepth

var getDepth: Function

highestDepth

static var highestDepth: Number
highest depth for all other objects

kBottom

static var kBottom: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

kCursor

static var kCursor: Number
constant used in calls to createClassObjectAtDepth/createObjectAtDepth

kNotopmost

static var kNotopmost: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

kTooltip

static var kTooltip: Number
constant used in calls to createClassObjectAtDepth/createObjectAtDepth

kTop

static var kTop: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

kTopmost

static var kTopmost: Number
constant used in calls to createClassChildtAtDepth/createChildAtDepth

lowestDepth

static var lowestDepth: Number
lowest allowed depth

numberOfAuthortimeLayers

static var numberOfAuthortimeLayers: Number
lowest depth plus this number of layers is reserved for statically placed content

reservedDepth

static var reservedDepth: Number
highest allowed depth is reserved for tooltips and cursors

swapDepths

var swapDepths: Function

Constructor Documentation

DepthManager

function DepthManager()
Only one depth manager is needed.

When created it adds the methods to the base classes


Method Documentation

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
depthFlag
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
depthFlag
depthSpace one of kTop, kBottom, kTopmost, kNoTopmost
initObj
object containing initialization properties
Returns:
reference to object

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

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

sortFunction

static function sortFunction(a: MovieClip,
 b: MovieClip): Number
sort the depths in the array of depths.

we don't need an equality test since depths can never be the same

test

static function test(depth: Number): Boolean
true if it is the reserved depth


The documentation was generated from the following file:


Copyright © 1997-2005 Macromedia, Inc. All rights reserved. Generated with AS2Doc