title: Randomize or shuffle an array
body: <p>Say I have an array:</p>
  
  <pre><code>myList:Array = new Array();
  myList = [1,2,3,4,5,6,7,8,9];
  
  myRandomList:Array = new Array();
  
  for (var i:uint = 0; i &lt; myList; i++) {
              var item:Number = Math.floor(Math.random() * myList.length-1) + 1;
              myRandomList.push(item);
        }
  </code></pre>
  
  <p>The only thing is, I'd like myRandomList to not have any duplicate numbers...is there a way to select a random number from the first list and then SUBTRACT it so I don't select that number twice?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I just saw this method of shuffling an array from shadetyler.blogspot.com/2008/12/array-shuffle-as3.html</p>
  
  <pre><code>Array.prototype.shuffle = function(){
  for(var i = 0; i &lt; this.length; i++){
  var a = this[i];
  var b = Math.floor(Math.random() * this.length);
  this[i] = this[b];
  this[b] = a;
  }
  </code></pre>
  
  <p>However, is there a way to rewrite this as a function?
      }</p>