MovieClip.getNextHighestDepth()
579
Description
Method; lets you determine if a particular depth is already occupied by a movie clip. You can use
this method before using
MovieClip.attachMovie()
,
MovieClip.duplicateMovieClip()
, or
MovieClip.createEmptyMovieClip()
to determine if the depth parameter you want to pass to
any of these methods already contains a movie clip.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Example
The following example writes the depth occupied by the
logo_mc
movie clip instance to the log
file:
this.createEmptyMovieClip("logo_mc", 1);
logo_mc.loadMovie("http://www.macromedia.com/devnet/mx/blueprint/articles/
nielsen/spotlight_jnielsen.jpg");
trace(this.getInstanceAtDepth(1)); // output: _level0.logo_mc
See also
MovieClip.getDepth()
,
MovieClip.getNextHighestDepth()
,
MovieClip.swapDepths()
MovieClip.getNextHighestDepth()
Availability
Flash Player 7.
Usage
my_mc
.getNextHighestDepth()
: Number
Parameters
None.
Returns
An integer that reflects the next available depth index that would render above all other objects on
the same level and layer within
my_mc
.
Description
Method; lets you determine a depth value that you can pass to
MovieClip.attachMovie()
,
MovieClip.duplicateMovieClip()
, or
MovieClip.createEmptyMovieClip()
to ensure that
Flash renders the movie clip in front of all other objects on the same level and layer in the current
movie clip. The value returned is 0 or higher (that is, negative numbers are not returned).
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Example
The following example creates a new movie clip instance,
logo_mc
, at the next highest depth
available. At runtime,
logo_mc
renders in front of all other instances at the same level.
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
var logo_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...