2 Replies Latest reply on Oct 24, 2009 2:35 AM by ma.tze

    define the class at runtime?

    ma.tze Level 1

      Hi,

       

      is it possible to do something like the following:

       

          public function readGenericClassEntity(myClass:Class,ac:ArrayCollection):void{

       

              var entity:myClass=myClass(ac.getItemAt(dataGrid.selectedIndex));

       

           }

       

      The part "entity:myClass" gives a compiler error:

       

           Type was not found or was not a compile-time constant: myClass.

       

      So is it possible to define the class at runtime?

       

      Thanks for any pointers!

       

      Martin Zach