4 Replies Latest reply on May 16, 2008 8:18 PM by clbeech

    Component /RemoveMovieClip Malfunction

    existing
      When I add a Text Area component to a MovieClip symbol - the MovieClip is exported for Actionscript, but not yet applied in the Actions panel - all removeMovieClip instances in my code do not work. If I delete just the Text Area component from the Library, all removeMovieClip instances in my code work once again. Any help on why this is happening, and most importantly how I can fix this problem? Thanks in advance!
        • 1. Re: Component /RemoveMovieClip Malfunction
          clbeech Level 3
          it states in the docs that if you use and calls to getNextHighestDepth() with version 2 Component instances they may not work - this is due to depth assignments becoming changed by the component and return a false depth outside the possible range. So I'm guessing you've used getNextHighestDepth when attaching MC instances. to remedy assign depths rather than using the method.
          • 2. Re: Component /RemoveMovieClip Malfunction
            existing Level 1
            Thanks for the help on this clbeech! That's clears things up for me. I always use MovieClip.getNextHighestDepth() :oops: . I just tried using MovieClip.unloadMovie(), but that doesn't work either. It works a little better, but only as good as MovieClip.clear() - by that, I mean that the MovieClip will be removed the first time the codes executes, then it reacts the same as removeMovieClip(), which does not work at all. I am going to have to look into the DepthManager class, and see what it can do for me. Thanks again!
            • 3. Re: Component /RemoveMovieClip Malfunction
              existing Level 1
              I've decided to use swapDepths() just before I use removeMovieClip(). It works great!

              EX:
              removeMC_btn.onRelease = function():Void {
              myMC.swapDepths(10000);
              myMC.removeMovieClip();
              }
              • 4. Re: Component /RemoveMovieClip Malfunction
                clbeech Level 3
                that's exactly right - the removeMovieClip() method only works for instances that have been added using attachMovie() or duplicateMovieClip() methods - in order to use it on MCs that were added in the IDE one must first use swapDepths() - nice work.