title: How to cache audio stream data and access it in AS3
body: <p>I'm streaming an MP3 file in AS3. All is working fine (I can play it) but I'm looking to implement a 'seek' bar. This means I will need to cache the file (as it's being downloaded) and then access the cached data when the user seeks a specific time in the song. </p>
  
  <p>The code to actually play the mp3 stream:</p>
  
  <pre><code>function openStream( stream )
  {
      var s:Sound = new Sound();
      var req:URLRequest = new URLRequest(stream);
      var context:SoundLoaderContext = new SoundLoaderContext(500, true);
      s.load(req, context);
      s.play();
  
  }
  </code></pre>
  
  <p>So how would I cache the file as it's being downloaded and then access the data from the cache? </p>
  
  <p>I know this is pretty far from a trivial task, so I would be grateful if you could even just provide a few links to some tutorials/docs/articles.</p>