title: In Flex3, what type is an object property?
body: <p>I have many Flex objects like this one:</p>
  
  <pre><code>public class MyData {
      public var time: Date;
      public var label: String;
  }
  </code></pre>
  
  <p>I am populating this object from a DB record retrieved via AMF that looks something like this:</p>
  
  <pre><code>{
      label: "Label",
      incident: "2009-08-15 11:12:14.12233"
  }
  </code></pre>
  
  <p>I want to write a generic value mapper for these object that, given a target object (instance of <code>MyData</code> here) and an input record, will be able to tell that <code>MyData.time</code> is a <code>Date</code> field and perform type mapping automatically.  Something like this:</p>
  
  <pre><code>function map(obj, targetType): * {
      var newInstance: * = new targetType();
      for (var property: String in obj) {
          if (getPropertyType(targetType, property) == Date) {
              newInstance[property] = parseDate(obj[property]);
          }
          else {
              newInstance[property] = obj[property];
          }
      }
  }
  
  function getPropertyType(type_var: Class, property: String): Class {
      // .. this is what I have no idea how to do
  }
  </code></pre>
  
  <p>Can someone fill in the blank here?</p>