title: How to declare array with custom indices, in Unity JavaScript?
body: <p>I'm looking for a way to store variables of same type in an array, and access them by their names. Like in PHP you do:</p>
  
  <pre><code>$array = array();
  $array['first member']=$var1;
  $array['another member']=$var2;
  // so on
  </code></pre>
  
  <p>I want to do a similar thing in Unity3D's JavaScript. I have AudioClip variables, currently used like this:</p>
  
  <pre><code>#pragma strict
  
  var Audio_Goal:AudioClip;
  var Audio_Miss:AudioClip;
  var Audio_Saved:AudioClip;
  
  
  function PlaySound_Goal()
  {   
      audio.PlayOneShot(Audio_Goal);  
  }
  
  function PlaySound_Miss()
  {   
      audio.PlayOneShot(Audio_Miss);  
  }
  </code></pre>
  
  <p>of course this requires one function per audioclip, which is ugly.</p>
  
  <p>I want to do it like this:</p>
  
  <pre><code>function PlayAudio(audioname:String)
  {
      audio.PlayOneShot(AudioArray[audioname]);
  }
  </code></pre>
  
  <p>How can I do this?</p>