2 Replies Latest reply on Apr 10, 2007 6:53 AM by maguskrool

    Dynamically create/change an .as file

    maguskrool
      Hi.

      I was wondering if it's possible to use the information on an XML file to dynamically define properties and methods on an .as file. Let's say I have a MyClass.as:

      class MyClass {
      //properties and methods for MyClass
      }

      Then I have a MyXML.xml:

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <properties>
      <public>
      <public_1>public_property_1</public_1>
      <public_2>public_property_2</public_2>
      ...
      <public_n>public_property_n</public_n>
      </public>
      <private>
      <private_1>private_property_1</private_1>
      <private_2>private_property_2</private_2>
      ...
      <private_n>private_property_n</private_n>
      </private>
      </properties>

      I would like MyClass to define its public and private properties using the data on MyXML.xml, can this be done? If so, can you at least give me some hints as to how it is done? Thank you.