2 Replies Latest reply on Mar 4, 2007 5:20 PM by Newsgroup_User


      I encountered the problem with getNextHighestDepth() returning invalid depths when a 2.0 Component is present. The Flash documentation was clear that if a 2.0 Component is present then depths should be managed with DepthManager. So I tried to find some info on this class. Here are some observations:

      1) The Flash documentation is very thin on exactly how the DepthManager is to be used, and especially how it replaces the attachMovie command. Several people have asked about it on this forum and one person seems to have found an answer. Karma-lab wrote:
      If you used to do something like:
      someClip.attachMovie("DynamicLoadScreen", "loadscreen_mc", someClip.getNextHighestDepth());
      Now do:
      import mx.managers.DepthManager; // at the beginning of your AS
      someClip.loadscreen_mc = someClip.createChildAtDepth("DynamicLoadScreen", DepthManager.kTop);
      Disposing it works thesame as previously.

      2) Someone who opens up a new Fla, in order to try this out might get confused when this code doesn’t attach anything (even if changing the linkage argument to something they have). The reason is that the library has to contain an arbitrary 2.0 Component for it to work. The docs are unclear on this. It says that 2.0 Components should be managed with DepthManager, but not that a 2.0 Component has to be in the library for DepthManager to work at all. One person has wrote on this subject lamenting that having to put an arbitrary Component (like a Button) in the library seems to make it impossible to make really small “lite weight” Flashes that use DepthManager.

      3) Some tests i made showed that getNextHighestDepth() worked fine, when it was called from another clip than _root / _level0, even when a 2.0 Component was in the library, and even when an instance of it was present in the clip! Is it safe to conclude that the problem with getNextHighestDepth() only occurs in _root?

      4) All this might be solved in AS 3.0?