User Guide
728 Chapter 2: ActionScript Language Reference
In a FLA or AS file that is in the same directory as Login.as, enter the following ActionScriptin
Frame 1 of the Timeline:
var gus:Login = new Login("Gus", "Smith");
trace(gus.username); // output: Gus
gus.username = "Rupert";
trace(gus.username); // output: Rupert
In the following example, the get function executes when the value is traced. The set function
triggers only when you pass it a value, as shown in the line:
gus.username = “Rupert”;
See also
get, Object.addProperty()