The Traits Object
New to the ActionScript language, the traits object was added to provide true class inheritance. The inclusion of a traits object greatly reduces the delay caused by property lookup. In previous ActionScript languages, object properties were shared among cloned objects by what was known as the prototype chain. If the property targeted on an instantiated object couldn't be found, the expected property is searched for within the next object up the chain, and the search continued until the top-level object was found.
The traits object vastly enhances property lookup by eliminating the need for the prototype chain. Every class, when compiled, possesses a number of objects, one of which is the new traits object. The traits object ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access