title: Flash AS3 eval()
body: <p>I'm new in AS3. I have 15 sounds in my fla; I imported them to the library and exported all sounds with the name <code>s1, s2, s3, ... s15</code></p>
  
  <p>I created a function that recieve the number and then play the sound.</p>
  
  <p>In AS2 I could use <code>eval</code> like <code>eval("s" + n)</code>, but in AS3 I can't!</p>
  
  <p>My AS3 code is:</p>
  
  <pre><code>function PlaySound(Num:Number=NaN) {
      var mySound:Sound = new ["s"+Num](); 
      mySound.play();
  }
  </code></pre>
  
  <p>Obviously I'm getting an error!</p>
  
  <p>Someone could help me?</p>
  
  <p>Best, Flávio</p>