December 30th, 2005
Access Modifiers in ActionScript 3.0
The Basic Access Modifiers are
- internal
- private
- public
- protected
internal is the default access modifier which is used if no other modifier is specified. It allows internal access and package-level access. Unlike in ActionScript 2.0 where it was treated as public, internal is not public but internal by default in ActionScript 3.0.
private is strictly private in ActionScript 3.0. Private is the most restrictive access modifier. It only allows internal access to members and it does not allow package-level access nor access from subclasses.
public is the least restrictive access modifier and thus allows access from anywhere.
protected allows internal access to members and access from subclasses but restricts package-level access.
(more…)