4 Replies Latest reply on Jun 29, 2007 9:30 PM by Newsgroup_User

    Duplicate Movie Clip Problem!!!

    Magiciandude
      Okay, here is my problem:
      When I added a duplicate movie clip script to my guy, he duplicates fine. But when he duplicates again it replaces the old duplicate!!! The main problem is that each NEW duplicate has a new name!!! I tested it with the namebox script at the end!

      onClipEvent(enterFrame){
      if(_root.randomtext >=.1 and _root.randomtext <=.15 and this._name=="frowny"){
      _root.i+=1
      duplicateMovieClip(_root.frowny, "frowny"+_root.i, this.getNextHighestDepth());
      }
      if(this._name!="frowny"){
      _root.namebox=this._name;
      this._x-=10;
      }
      }

      Please help!!!

      Thanks!

      -Chris
        • 1. Re: Duplicate Movie Clip Problem!!!
          Magiciandude Level 1
          Anybody?
          Please?

          -Chris
          • 2. Re: Duplicate Movie Clip Problem!!!
            kglad Adobe Community Professional & MVP
            is that code attached to _root.frowny? and if the previous movieclips are being replaced it's because your depths aren't changing. but it just might be that the old movieclips are below the duplicated ones and not visible to you.
            • 3. Re: Duplicate Movie Clip Problem!!!
              Magiciandude Level 1
              Yes...the code is on the frowny movie clip.
              But the code says only to duplicate if his name is the original frowny. And every time it duplicates it sends it back to the original frowny's position and deletes the one thats already moved halfway across the screen!

              Also, why wouldn't the depth be changing? Is there a way to fix it if that IS the problem? I used this.getNextHighestDepth()) though...

              Well...thanks for your reply anyway!

              -Chris
              • 4. Re: Duplicate Movie Clip Problem!!!
                Level 7
                Magiciandude wrote:
                > Okay, here is my problem:
                > When I added a duplicate movie clip script to my guy, he duplicates fine. But
                > when he duplicates again it replaces the old duplicate!!! The main problem is
                > that each NEW duplicate has a new name!!! I tested it with the namebox script
                > at the end!
                >
                > onClipEvent(enterFrame){
                > if(_root.randomtext >=.1 and _root.randomtext <=.15 and this._name=="frowny"){
                > _root.i+=1
                > duplicateMovieClip(_root.frowny, "frowny"+_root.i,
                > this.getNextHighestDepth());
                > }
                > if(this._name!="frowny"){
                > _root.namebox=this._name;
                > this._x-=10;
                > }
                > }
                >
                > Please help!!!
                >
                > Thanks!
                >
                > -Chris
                >

                Is this the effect you are going for?

                onClipEvent(enterFrame){
                if(_root.randomtext >=.1 and _root.randomtext <=.15 and
                this._name=="frowny"){
                _root.i+=1
                var item = duplicateMovieClip(this, "frowny"+_root.i,
                this._parent.getNextHighestDepth());
                trace(item);
                }
                if(this._name!="frowny"){
                _root.namebox=this._name;
                this._x-=10;
                }
                }