8 Replies Latest reply on May 10, 2009 9:01 PM by Bob in SC

    created first class...help w/a pretty basic error

    Bob in SC

      i've created my first class (class is Server() located in package resources). All the class is, is a collection of about 5 string variables. I did not define a constructor as part of the class and i'm wondering if that's what causing the problem i'm seeing. Autocomplete seems to be working fine as it finds the class members but i'm getting the following error when i try and set a class member to a value.

       

      error = 1120: Access of undefined property foo

       

      Can someone give me a pointer?

       

      Here's the class definition

       

       

       

       

       

       

      package

       

       

      resources {

       

       

       

       

       

           public class Server {

       

       

       

       

       

                public var ServerName:String;

       

       

       

       

       

                public var ServerIPAddress:String;

       

       

       

       

       

                public var ServerWeight:Number;

       

       

       

       

       

                public var ServerProtocol:String;

       

       

       

       

       

                public var ServerPath:String;

       

       

       

       

       

                public var ServerPort:Number;

       

       

       

       

       

       

                public function Server()

       

                    {

       

       

       

       

       

       

                    //TODO: implement function

       

       

       

       

       

       

       

       

       

       

       

       

                    }

       

           }

      }

       

       

       

       

      and here's how i use it

       

       

       

       

       

       

       

       

       

       

      import resources.Server;

       

       

       

      public var foo:Server = new Server();

      foo.ServerIPAddress =

      "1.2.3.4";