3 Replies Latest reply on Nov 17, 2006 12:27 PM by SharkEater

    removeMovieClip and duplicateMovieClip

    SharkEater
      Hallo,

      I do like to drag and drop multiple copies of an element onto a target MovieClip from a PopUp Window..

      I Can open the popup window and drag and drop onto target MC to create an instance of the Movie Clip which is present in popup. I use duplicateMovieClip to create instances.

      duplicateMovieClip(obje,"oWindow"+pointer,pointer) ;
      eval("oWindow"+pointer)._x = 100;
      eval("oWindow"+pointer)._y = 200+pointer+20;


      I have a Close button on the Popup which removes it from the stage.

      on (press){
      //this.unloadMovie();
      this.removeMovieClip();
      }


      This action removes all the instances creating using them along with the Popup.

      I do like to keep the instances.

      Any suggestions.

      Madanagopal.
        • 1. Re: removeMovieClip and duplicateMovieClip
          clbeech Level 3
          Does the MC your duplicating exist in the main page's timeline or Library?

          Perhaps you need to either use attachMovieClip( ... ), where you can rename the instance name dynamically. Or control the depth and track it so that you can point to the level and use removeMovieClip(). (better by using the instance name though ie. "your_mc_instance.removeMovieClip(); ")

          Also note that if your using any type2 Components in your work, these can cause "unexpected" results when calling getNextHighestDepth() and removeMovieclip() commands.
          • 2. Re: removeMovieClip and duplicateMovieClip
            arunbe Level 1
            In which movie clip you are having this buttons ???
            and where you are dublicating the moviclips ????
            • 3. Re: removeMovieClip and duplicateMovieClip
              SharkEater Level 1
              The icons for creating instances is in a seperate movie clip called PopUp, which can be opened by a Open Button. And this PopUp has a Close Button to make it disappear.


              I am trying to drag these icons onto an another target MovieClip, this creates instance of the Icon movie clip on the targetMovieClip.

              When the Close button is pressed, this removes all the duplicate movie clips created.

              And. Clbeech, I havent yet changed the way i address my movieclip while closing the popup movieclip. Thanks for the comments anyway..

              thank you guys.

              Madanagopal.