6 Replies Latest reply on Oct 16, 2006 4:02 AM by Newsgroup_User

    getNextHighestDepth  and   removeMovieClip  problem

    Level 7
      hi,

      I have a strange problem :

      I attach a Mc from library to Scene like this :

      var mc : MovieClip = _root.attachMovie ("mcLinkage",
      "mc1",_root.getNextHighestDepth() ,
      {
      _visible : false
      });

      and then i try to remove it by

      removeMovieClip(_root.mc1);

      and, mc is doesnt removed.

      but if i give a level number instead of getNextHighestDepth(), mc is able to
      removed.

      any succestion about this stuation?

      regards.
      Burak


        • 1. Re: getNextHighestDepth  and   removeMovieClip  problem
          Palin_Exnihilo Level 1
          Seems like getNextHighestDepth() gives to you movieClip an depth that cause your movieclip being unable to get deleted by Actionscript. You should always set your movieClip with custom depth before deleting them...

          Look for help on removeMovieClip() in the AS docs or on MovieClip's depths

          Palin
          • 2. getNextHighestDepth  and   removeMovieClip  problem
            coldMiner Level 1
            try mc.removeMovieClip();

            quote:

            Originally posted by: Palin Exnihilo
            Seems like getNextHighestDepth() gives to you movieClip an depth that cause your movieclip being unable to get deleted by Actionscript. You should always set your movieClip with custom depth before deleting them...
            ??? What is custom depth
            explain this then:
            • 3. Re: getNextHighestDepth  and   removeMovieClip  problem
              S4Potential Level 1
              coldMiner is right, removeMovieClip() doesn't take parameters.

              Try with the full path if used within another movieclip:
              _root.mc1.removeMovieClip();
              • 4. Re: getNextHighestDepth  and   removeMovieClip  problem
                Level 7
                thankyou for reponses,
                I had tried to use mc.removeMovieClip(). but this not worked.
                strange problem. and yes, if I give a spesific number for depth, removeClip
                can remove mc. but, i have to use getNextHighestDepth();

                regards
                Burak
                www.delizade.com

                "S4Potential" <webforumsuser@macromedia.com> wrote in message
                news:egm3em$a09$1@forums.macromedia.com...
                > coldMiner is right, removeMovieClip() doesn't take parameters.
                >
                > Try with the full path if used within another movieclip:
                > _root.mc1.removeMovieClip();


                • 5. Re: getNextHighestDepth  and   removeMovieClip  problem
                  Level 7
                  The function (in contrast to the method) removeMovieClip(target:Object)
                  still should work (not even deprecated yet :). It's in the Global
                  Functions section.
                  However, from the helpfiles removeMovieClip() topic:
                  -----------------------------------------------------
                  Note: If you are using version 2 components, do not use this method. If
                  you place a version 2 component either on the Stage or in the Library,
                  the getNextHighestDepth() method can sometimes return depth 1048676,
                  which is outside the valid range. If you are using version 2 components,
                  you should always use the version 2 components DepthManager class.

                  Note: If you are using version 2 components, and use
                  MovieClip.getNextHighestDepth() instead of the version 2 components
                  DepthManager class to assign depth values, you may find that
                  removeMovieClip() fails silently. When any version 2 component is used,
                  the DepthManager class automatically reserves the highest (1048575) and
                  lowest (-16383) available depths for cursors and tooltips. A subsequent
                  call to getNextHighestDepth() returns 1048576, which is outside the
                  valid range. The removeMovieClip() method fails silently if it
                  encounters a depth value outside the valid range. If you must use
                  getNextHighestDepth() with version 2 components, you can use
                  swapDepths() to assign a valid depth value or use
                  MovieClip.unloadMovie() to remove the contents of the movie clip.
                  Alternatively, you can use the DepthManager class to assign depth values
                  within the valid range.
                  ------------------------------------------------------

                  It made me bang my head against anything hard for a while not too long
                  ago...

                  Look for the DepthManager Class in the components dept. of the helpfiles.

                  Manno

                  Burak Delice wrote:
                  > thankyou for reponses,
                  > I had tried to use mc.removeMovieClip(). but this not worked.
                  > strange problem. and yes, if I give a spesific number for depth, removeClip
                  > can remove mc. but, i have to use getNextHighestDepth();
                  >
                  > regards
                  > Burak
                  > www.delizade.com
                  >
                  > "S4Potential" <webforumsuser@macromedia.com> wrote in message
                  > news:egm3em$a09$1@forums.macromedia.com...
                  >> coldMiner is right, removeMovieClip() doesn't take parameters.
                  >>
                  >> Try with the full path if used within another movieclip:
                  >> _root.mc1.removeMovieClip();
                  >
                  >

                  --
                  ----------
                  Manno Bult
                  manno@xs4all.nl
                  • 6. Re: getNextHighestDepth  and   removeMovieClip  problem
                    Level 7
                    thankyou very much...

                    strange stuation. and sometimes I think that Flash takes times from my
                    lifetime! :)

                    regards


                    "Manno Bult" <removethis.manno@xs4all.nl> wrote in message
                    news:egnlce$7da$1@forums.macromedia.com...
                    > The function (in contrast to the method) removeMovieClip(target:Object)
                    > still should work (not even deprecated yet :). It's in the Global
                    > Functions section.
                    > However, from the helpfiles removeMovieClip() topic:
                    > -----------------------------------------------------
                    > Note: If you are using version 2 components, do not use this method. If
                    > you place a version 2 component either on the Stage or in the Library, the
                    > getNextHighestDepth() method can sometimes return depth 1048676, which is
                    > outside the valid range. If you are using version 2 components, you should
                    > always use the version 2 components DepthManager class.
                    >
                    > Note: If you are using version 2 components, and use
                    > MovieClip.getNextHighestDepth() instead of the version 2 components
                    > DepthManager class to assign depth values, you may find that
                    > removeMovieClip() fails silently. When any version 2 component is used,
                    > the DepthManager class automatically reserves the highest (1048575) and
                    > lowest (-16383) available depths for cursors and tooltips. A subsequent
                    > call to getNextHighestDepth() returns 1048576, which is outside the valid
                    > range. The removeMovieClip() method fails silently if it encounters a
                    > depth value outside the valid range. If you must use getNextHighestDepth()
                    > with version 2 components, you can use swapDepths() to assign a valid
                    > depth value or use MovieClip.unloadMovie() to remove the contents of the
                    > movie clip. Alternatively, you can use the DepthManager class to assign
                    > depth values within the valid range.
                    > ------------------------------------------------------
                    >
                    > It made me bang my head against anything hard for a while not too long
                    > ago...
                    >
                    > Look for the DepthManager Class in the components dept. of the helpfiles.
                    >
                    > Manno
                    >
                    > Burak Delice wrote:
                    >> thankyou for reponses,
                    >> I had tried to use mc.removeMovieClip(). but this not worked.
                    >> strange problem. and yes, if I give a spesific number for depth,
                    >> removeClip can remove mc. but, i have to use getNextHighestDepth();
                    >>
                    >> regards
                    >> Burak
                    >> www.delizade.com
                    >>
                    >> "S4Potential" <webforumsuser@macromedia.com> wrote in message
                    >> news:egm3em$a09$1@forums.macromedia.com...
                    >>> coldMiner is right, removeMovieClip() doesn't take parameters.
                    >>>
                    >>> Try with the full path if used within another movieclip:
                    >>> _root.mc1.removeMovieClip();
                    >>
                    >>
                    >
                    > --
                    > ----------
                    > Manno Bult
                    > manno@xs4all.nl