8 Replies Latest reply on Aug 23, 2007 11:45 AM by levancho

    Cannot reach class methods

    axe-23
      Hi, I am a newbee to Flex and a I have this problem:

      I have MXML application and actionscript class file User.as. Problem is that I cant reach class method from MXML application. I am using Flex 3.0 Beta 1 Release.

      User.as: (stored in users/Users.as)

      package users
      {
      public class User
      {
      private var login:String;
      private var pass:String;
      private var email:String;
      private var firstname:String;
      private var lastname:String;

      public function User() {
      this.login = "";
      this.pass = "";
      this.email = "";
      this.firstname = "";
      this.lastname = "";
      }

      public function setLogin(log:String):void {
      this.login = log;
      }
      }
      }

      application:

      import users.User; //import class
      var Person:User = new User(); // create new object of class User
      Person.setLogin("somelogin"); //using a class method

      I got this error: "Access of undefined property Person"

      I am looking for a solution. Any help much appreciated

      Thanks