2 Replies Latest reply on Aug 29, 2006 1:42 PM by Delodic

    Dynamically creating properties for Objects

    Delodic
      I want an Array with data, to act as dataprovider for my chart. If I make this in mxml, I make an Array of objects. The objects will have the form of

      quote:


      <mx:Object id="serie1_point1" serie1X="{value1}" serie1Y="{value2}"/>


      Now I want to dynamically create an Array in AS3 with this kind of objects (because otherwise the chart component doesn't get the data). So imagine I have var name:String = "serie2X", how can I make this string an property of a new object?

      I've tried the following:

      quote:

      var property1:String = "serie3X";
      var result:Object = new Object();
      result.property1 = *a certain value*



      This didn't work. What I wanted was that when I ask the value:

      result.serie3X

      I get the *a certain value*


      Is this possible?