title: duplicateMovieClip in Action Script 3
body: <p>My question is how to do this:
  <a href="https://www.dropbox.com/s/zi63y771h38a2vo/Example.fla" rel="nofollow">https://www.dropbox.com/s/zi63y771h38a2vo/Example.fla</a></p>
  
  <p>In Action Script 3.0.</p>
  
  <p>This is working timeline source code, with ready indexing values + sorting news via array.
  Simple as that, how to create same thing in ActionScript 3.0?</p>
  
  <p>I was searching on the websites/forums and I couldn't find any answer that was satisfying me, so I decided to create an account in here and ask for help.</p>
  
  <p>If someone could remake this example on ActionScript 3.0, this could help us all, because I saw a lot of questions about duplicateMovieClip() function, but there were no strict answer  + example on it, so maybe let's create this?</p>
  
  <p>This is my suggestion, code is in file or here:</p>
  
  <pre><code>    stop();
  
      var IDMovieClip = 0;
      var IDarray = 0;
      var Duplicate:MovieClip;
      MC._visible = false;
      var ARRAY:Array = new Array();
  
      ENTER.onRelease = function() {
          Duplicate = MC.duplicateMovieClip(IDMovieClip, _root.getNextHighestDepth());
  
          var ref = eval(Duplicate);
          ref.ID = IDMovieClip;
          ref.sortedID = IDarray;
  
          _root[ref.ID].windowID.text = "ID: " + ref.ID;
  
          Duplicate.Close.onRollOver = function() {
              trace(_root[ref.ID]._target);
          };
  
          Duplicate.Close.onRelease = function() {
              _root.ARRAY.splice(_root[ref.ID].sortedID,1);
              removeMovieClip(_root[ref.ID]);
              IDarray -= 1;
              _root.doSort();
          };
  
          ARRAY.push([IDarray, IDMovieClip]);
          doSort();
  
          IDMovieClip += 1;
          IDarray += 1;
      };
  
      doSort = function () {
          for (var i = 0; i &lt; ARRAY.length; i++) {
              _root[ARRAY[i][1]]._y = 10 + ((_root[ARRAY[i][1]]._height + 10) * i);
              _root[ARRAY[i][1]].sortID.text = i;
              _root[ARRAY[i][1]].sortedID = i;
              trace(ARRAY[i]);
          }
      };
  </code></pre>
  
  <p><a href="https://www.dropbox.com/s/hdxxuosok5x7bip/Question.jpg" rel="nofollow">FLA PROJECT DESIGN IN JPG (MovieClips/Placement etc)</a></p>
  
  <p>(what You need to run it, if You dont want to download it from my DropBox)</p>
  
  <p>If anyone could help, that would be great.</p>