title: Dynamic changing picture in ActionScript 3 without flickering
body: <p>I want to have a image in my Flash file which can be changed from another program. </p>
  
  <p>In ActionScript 2 I used a  <code>Loader</code>, set the <code>contentPath</code> and made a <code>Motiontween</code> in the Timeline this worked very well.</p>
  
  <p>But now in Actionscript 3 I do the same, I use the <code>UILoader</code>, I set the <code>source</code> and create a <code>Motiontween</code> but now  the image disappears for a short time, everytime the Tween starts over again.</p>
  
  <p>Is there a way to do this properly?</p>
  
  <p>My code right now:</p>
  
  <pre><code>var myXML:XML;
  var myLoader:URLLoader = new URLLoader();
  
  var text:String;
  var imagePath:String;
  
  myLoader.load(new URLRequest("C:/Flash/paths.xml"));
  myLoader.addEventListener(Event.COMPLETE, processXML);
  
  function processXML(e:Event):void
  {       
      myXML = new XML(e.target.data);
  
      text = myXML.text;
      imagePath = myXML.path;
  
      TextContainer.text = team1name;
      imageContainer.source = team2logoPath;
  
      trace("trace");    
  }
  </code></pre>
  
  <p>The text isn't flickering but the image is, so I don't think the XML Loader is the reason that it works with and not with AS3.</p>
  
  <p>Even if I only change the source of the image every time, the image gets invisible for a short time:</p>
  
  <pre><code>imageContainer.source = "C:/images/no_image.png";
  </code></pre>