Welcome, Guest
  • Author Topic: V2 Components and the trouble with depths  (Read 6119 times)

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    V2 Components and the trouble with depths
    « on: 03/21/07, 15:20 »
    If you use Flash 8, and you are frequently changing movieclips, you get into trouble usind V2 components.
    Then you google around - and find out: there is a new DepthManager Class managing the depth of the V2 components.
    Because this is so, it may overwrite, ore move your manualy set depth. Even getNextHighestDepth() might not give you a valid depth.
    Movieclips, you'd like to remove, are not removable anymore. And others just disapear by the hand of a hungry ghost.

    The only way to prevent all this, is using the depthmanager yourself.

    With the depthmanager you only can load movieclips existing in your library.
    But you can create a empty symbol (movieclip), and use it like you would use createEmptyMovieClip();

    instead of createEmptyMovieClip() and then loadMovie, jus use a loader component.
    Then the call looks like this:

    myClip=createChildAtDepth("Loader",DepthManager.kTop,{_x:yourX, _y:yourY, contentPath:"path and filename to your picture or external movieclip"});

    Have fun playing around with this class.

    BTW: in future (Flash 9 AS 3.0) it will look similar - no createEmptyMovieClip anymore ;)
    happy flashing
    8)
    Ronald