Classes in AS3 do have Properties but with some limitations. This code will compile fine:

?View Code ACTIONSCRIPT
package {
  public class ClassA {
 
    var _max : String;
 
    public function get max() : String {
      return _max;
    }
 
    private function set max(max : String) : void {
      _max = max;
    }
  }
}

But this won’t:

?View Code ACTIONSCRIPT
package {
  public class ClassA {
 
    var _max : String;
 
    public function ClassA() {
      trace('max: ' + (max));
    }
 
    public function get max() : String {
      return _max;
    }
 
    private function set max(max : String) : void {
      _max = max;
    }
  }
}

Looks like if you mix property visibilities you can’t refer to it any more.

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Before you submit form:
Human test by Not Captcha

© 2011 Max Blog Suffusion theme by Sayontan Sinha