title: Actionscript 3 How to Load PNG onto Stage based on Web Service Value?
body: <p>Good Morning,</p>
  
  <p>I am querying the weather.com XML web service to obtain current temp, feels like temp and current condition icon.  I have the first two values going to separate text fields on stage, and that's working great.  However, I'm now trying to implement a switch statement such that the current condition icon value in the XML is read by my script and the corresponding PNG becomes the UILoader source value.  </p>
  
  <p>First and foremost, is UILoader the best component for use in displaying a PNG on stage?</p>
  
  <p>Here's my code thus far:</p>
  
  <pre><code>var src: UILoader.source=uicondicon.source;
  switch(src){
  case "0 PNG":                   
  src=trace(resultXML.cc.icon)=0;
  break;
  case "11 PNG":
  src=trace(resultXML.cc.icon)=11;
  break;
  default src=trace(resultXML.cc.icon)=0:
  }
  </code></pre>
  
  <p>When I compile the above code, I receive error 1084 expecting colong before src in the final line of code (my default assignment).</p>
  
  <p>Given that there are 47 different icons that may need to be displayed, is this the best way to implement this functionality?  </p>
  
  <p>Finally, how do I make the UILoader component display only during a certain set of frames in the application?</p>
  
  <p>Thanks much!!</p>