title: AS2 - play multiple sounds together
body: <p>I'm working on a little Flash game and I'm having troubles playing different sounds simultaneously.</p>
  
  <p>For example, when the player passes through a tower, a gong sound is played;
  when the player jumps, a jump sound is played.
  Those two actions can occur at the same time, and the two sounds should be played together (overlapping) if that is the case.</p>
  
  <p>Those sounds are declared as follows:</p>
  
  <pre><code>s_jumping = new Sound();  
  s_jumping.attachSound("s_jump");  
  s_noise2 = new Sound();  
  s_noise2.attachSound("s_gong");  
  </code></pre>
  
  <p>And then they are called (when needed) with a simple <code>s_jumping.start(0,1);</code> or <code>s_noise2.start(0,1);</code>.<br>
  Nowhere in my code am I ever calling a <code>s_jumping.stop()</code> or <code>s_noise2.stop()</code>.</p>
  
  <p>Those sounds work fine when played separately, but when played together, it won't work. The first sound stops when the second sound is fired.</p>
  
  <p>I thought that using <code>new Sound()</code> with a different variable name would mean that those sound would exist separately. Instead it's like one sound overrides the other.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>(Note: I'm not trying to play a huge number of sounds here. In my tests there are at most 3 sounds at the same time.)</p>
  
  <p><strong>Update:</strong> after further testing, those sounds play fine if I remove one background sound that I have. So it seems I hit a limit of some kind. What's strange is that at the moment I play at most 3 or 4 sounds simultaneously. From what I read it should be OK with at least 8 sounds!<br>
  (Note: Using Flash CS4, actionscript 2, and exporting for Flash Player 8.)</p>