Flash Player 7.
my_mc.getNextHighestDepth(): Number
None.
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.
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).
For more information, see "Managing movie clip depths" in Using ActionScript in Flash.
You can extend the methods and event handlers of the MovieClip class by creating a subclass. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
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();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc.onPress = function() {
this.startDrag();
};
target_mc.onRelease = function() {
this.stopDrag();
};
};
logo_mcl.addListener(mclListener);
logo_mcl.loadClip("http://www.macromedia.com/devnet/blueprint/articles/nielsen/spotlight_jnielsen.jpg", logo_mc);
MovieClip.getDepth(), MovieClip.getInstanceAtDepth(), MovieClip.swapDepths()
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001507.html
Comments
TroyWorks said on Aug 26, 2004 at 2:02 AM :