Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As we've seen throughout this book, most objects in ActionScript are created using classes. However, it is also possible to create objects using standalone function closures. The following code shows the basic approach. It uses an example function, Employee( ), to create an object:
// Create the function
function Employee () {
}
// Use the function to create an object, and assign that
// object to the variable, worker
var worker = new Employee();