0 Replies Latest reply on Mar 12, 2009 4:40 PM by Rahil Kidwai

    Problem making a class property binable

    Rahil Kidwai Level 1
      The following error is thrown on compilation if you make a property having the name similar to that of class.
      1046: Type was not found or was not a compile-time constant: Member

      public class Model
      {
      private var _member : Member;
      public function get Member() : Member { return this._member; }
      public function set Member( value : Member ) : void { this._member = value; }
      }

      Remedy is to use the fully qualified name for the class, like:

      public class Model
      {
      private var _member : Member;
      public function get Member() : com.company.Member { return this._member; }
      public function set Member( value : com.company.Member ) : void { this._member = value; }
      }

      But the same error will be reported if you now make this property bindable.

      public class Model
      {
      private var _member : Member;
      [Bindable]
      public function get Member() : com.company.Member { return this._member; }
      public function set Member( value : com.company.Member ) : void { this._member = value; }
      }

      Is there a workaround / solution to this problem. Am I missing something. Also changing the property name is not a possibility as it will roll into lot of changes in code base.

      [Bindable] com.company.Member