title: Loading an embedded image in AS3
body: <p>OK, I feel dumb asking this, but I've spent the whole afternoon trying to figure it out, without success.</p>
  
  <p>In AS3, I want to add an image to the Library (let's call it image.png) and instantiate it using just code.</p>
  
  <p>I succeeded in instantiating an external image this way</p>
  
  <pre><code>var pLoad:Loader = new Loader();
  pLoad.load(new URLRequest("image.png"));
  addChild(pLoad);
  </code></pre>
  
  <p>But no matter what I tried, I can't do the same loading the image from the library. How is that done?</p>
  
  <p>Aside : I've seen the [embed] syntax but ideally I'd like to avoid hardcoded image names, that is, I want to choose an image, and thus generate the image name, programatically.</p>