4 Replies Latest reply on May 6, 2008 12:49 PM by chodge

    removeMovieClip

    chodge Level 1
      I have this code:

      this.attachMovieClip("TP10","TP10",this.getNextHighestDepth());
      this.TP10.onRelease = function() {this.removeMovieClip(this.TP10);}

      Everything works except for the removeMovieClip. I've even tried this.TP10.removeMovieClip();
      I'm using Flash 9 publishing to Flash version 8 ActionScript 2.
        • 1. Re: removeMovieClip
          Level 7
          >> this.attachMovieClip("TP10","TP10",this.getNextHighestDepth());
          this.TP10.onRelease = function() {this.removeMovieClip(this.TP10);}

          Change that to:

          this.attachMovie("TP10","TP10",this.getNextHighestDepth());
          this.TP10.onRelease = function() {this._parent.TP10.removeMovieClip();}

          --
          Dave -
          www.offroadfire.com
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/


          • 2. Re: removeMovieClip
            chodge Level 1
            thanks for the reply, but still no success:
            this.TP10.onRelease = function() {this._parent.TP10.removeMovieClip();}
            this.TP10.onRelease = function() {this.removeMovieClip(_parent.TP10);}
            this.TP10.onRelease = function() {this._parent.removeMovieClip(TP10);}
            this.TP10.onRelease = function() {removeMovieClip(this._parent.TP10);}
            • 3. Re: removeMovieClip
              Cliff Johnson
              >> this.attachMovieClip("TP10","TP10",this.getNextHighestDepth());
              this.TP10.onRelease = function() {this.removeMovieClip(this.TP10);}

              >>Change that to:

              >>this.attachMovie("TP10","TP10",this.getNextHighestDepth());
              this.TP10.onRelease = function() {this._parent.TP10.removeMovieClip();}

              I have had success using the movie pathname directly, such as eval("/moviePathName").removeMovieClip();

              Perhaps "this" and "_parent" are gumming up the works?

              • 4. Re: removeMovieClip
                chodge Level 1
                the second I read your post the light went on and I remembered the last time I did this that was the solution. Great Job, thanks for the help (everyone)