MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 499

Components language reference
Table of Contents

Advertisement

Parameters
One of the following values:
,
,
depthFlag
DepthManager.kTop
DepthManager.kBottom
,
. All depth flags are static properties
DepthManager.kTopmost
DepthManager.kNotopmost
of the DepthManger class. You must either reference the DepthManager package (for
example,
) or use the
statement to import
mx.managers.DepthManager.kTopmost
import
the DepthManager package.
Returns
Nothing.
Description
Method; sets the depth of
to the value specified by
. This
movieClipInstance
depthFlag
method moves an instance to another depth to make room for another object. DepthManager
uses a "shuffling" algorithm to set the depths in increments of 20. The algorithm increments
depths in case Flash needs to insert something else in the middle, based on other scripts,
components, and so on.
Example
The following example uses two components (or movie clips) to raise their depth alternately
in increments of 20 as each one is clicked. First add a Button component to the Stage and give
it instance name
Then add another Button component to the Stage and give it instance
a_btn
name
. Make sure the buttons overlap as follows:
b_btn
import mx.managers.DepthManager;
a_btn.onRelease = function() {
b_btn.setDepthTo(DepthManager.kTop);
var b_depth:Number = b_btn.getDepth();
trace(b_depth);
}
b_btn.onRelease = function() {
a_btn.setDepthTo(DepthManager.kTop);
var a_depth:Number = a_btn.getDepth();
trace(a_depth);
}
DepthManager.setDepthTo()
497

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents