title: AS3: Is the "new SoundChannel()" allocation pointless?
body: <p>I see a lot of guides that do something like this:</p>
  
  <pre><code>var mySound:Sound = new Sound();
  var myChannel:SoundChannel = new SoundChannel(); //unnecessary allocation?
  myChannel = mySound.play();
  </code></pre>
  
  <p>Is allocating a new SoundChannel() in the second line completely unnecessary? From the docs, it seems that <code>Sound.play</code> generates a new SoundChannel every time, so you're not forcing it to use that SoundChannel that was just allocated, right? What the second line actually does is allocate a new SoundChannel, which does nothing, and assigns the variable myChannel to it. Then in the third line, mySound.play() generates a new SoundChannel and makes myChannel point to it instead, leaving the first SoundChannel inaccessible.</p>
  
  <p>Should the second line just be this?</p>
  
  <pre><code>var myChannel:SoundChannel;
  </code></pre>
  
  <p>There are several guides which seem to do that unnecessary allocation, including an <a href="https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play()" rel="nofollow noreferrer">example</a> in the official docs.</p>