0 Replies Latest reply on Aug 11, 2011 7:39 PM by jerimac2

    Dynamically create a FormItem in ActionScript


      I'm trying to dynamically build a Form, and I have no problem creating the Form and FormHeading elements.  But the following declaration is generating the indicated compiler errors:


           var fieldItem:FormItem = new FormItem();


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

           -1180: Call to a possibly undefined method FormItem.


      I included the following import statements:


           import spark.components.Form;

           import spark.components.FormHeading;

           import spark.components.FormItem;


      and the following declarations work fine:


           var viewForm:Form = new Form();

           var groupHeading:FormHeading = new FormHeading;


      Does FB4 require a different way of instantiating a FormItem in ActionScript?