title: ActionScript Setting Object Properties From Other Object Properties?
body: <p>i'm attempting to cast an object's property as an actual property of another object.</p>
  
  <p>here's my object variable:</p>
  
  <pre><code>var propObj:Object = {prop:"width", width:50};
  </code></pre>
  
  <p>now i want to assign the property of a sprite using that object's properties.</p>
  
  <pre><code>var sp:Sprite = new Sprite();
  sp.(propObj.prop as Sprite.property) = propObj.width;
  </code></pre>
  
  <p>now, i'm not even going to try that because i know the compiler will explode all up in my face.  but you should be able to see what i'm trying to do.</p>
  
  <p>why i'm trying to do it is because i'm reading in an XML file with an undetermined list of usable properties for specific objects.  so instead of writing something like a huge switch statement to evaluate whether the XML file has a value for that specific property, i'm trying to assign properties dynamically based on what's available in the XML file.</p>
  
  <p>if what i'm trying to do is possible, what's the best way to do it?</p>