title: AS2 Array random selection
body: <p>How can I make an array in flash as2 and from there select 12 values assigning them to twelve different variables?</p>
  
  <p>So far I got this:</p>
  
  <pre><code>quotes = new Array();
  
  
  quotes[0] = "one";
  quotes[1] = "two";
  quotes[2] = "three";
  quotes[3] = "four";
  quotes[4] = "five";
  quotes[5] = "six";
  quotes[6] = "seven";
  quotes[7] = "eight";
  quotes[8] = "nine";
  quotes[9] = "ten";
  quotes[10] = "eleven";
  quotes[11] = "twelve";
  quotes[12] = "thirteen";
  quotes[13] = "fourteen";
  quotes[14] = "fifteen";
  quotes[15] = "sixteen";
  quotes[16] = "seventeen";
  quotes[17] = "eighteen";
  quotes[18] = "nineteen";
  quotes[19] = "twenty";
  </code></pre>
  
  <p>Im keeping this structure because it will be easier to maintain in the long run and has more readability.</p>
  
  <p>What I dont know is how to take twelve random values out of it and assign them to variables.</p>
  
  <p>Ok, so I have now added this piece:</p>
  
  <pre><code>trace(quotes)
  for(var i:Number = 0; i&lt;12; i++){
            var x:Number = Math.floor((Math.random()*quotes.length));
            trace("X :: " + x);
            trace("ARRAY VALUE :: " + quotes[x]);
            quotes.splice(x,1);          
       }
  </code></pre>
  
  <p>Now I see in the trace 12 different values without repetition.
  But still I dont know how to make the results be the values of 12 different vars.</p>