0 Replies Latest reply on Mar 12, 2009 7:40 PM by Newsgroup_User

    Re: Problem making a class property binable

    Level 7

      "Rahil Kidwai" <webforumsuser@macromedia.com> wrote in message
      news:gpc6h8$55e$1@forums.macromedia.com...
      > 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.

      There's a reason why the convention is to always use capital letters for
      starting class names and lowercase letters for properties.