2 Replies Latest reply on Apr 19, 2010 12:52 PM by blacksyforce

    getDefinitionByName() error

    blacksyforce

      Hy, I have a problem with the getDefinitionByName(). I am trying to create an instance of "Item" (AS class) but I get the "ReferenceError: Error #1065: Variable Item is not defined." error. Actually I get this error with every class I try except for the swc files and those classes that do not need import: int, Number, String, etc.

       

      import Classes.Item

      import flash.utils.getDefinitionByName;
             
      private function init():void
      {
           var forCompiler:Item;
           var ClassType:Class = getDefinitionByName("Item") as Class;

           var tmpItem:* = new ClassType();
      }

       

      Thanks in advance.