User Guide

200 Chapter 5: ActionScript Core Language Elements
In a FLA or AS file that is in the same directory as Login.as, enter the following ActionScript:
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()