Here’s how to create a external class using ActionScript 3. In AS2, I was already familiar with instances of objects in the library. Defining a class is basically the same thing.
Why would you want to do this? In a sense, this is where AS3 as an object oriented programming language has finally been realized. You can create a class (object) with its own properties, completely self-contained in an external AS file, making it portable across .fla files. You could code the class so it “draws itself” (not as I have done below) so it wouldn’t even require a symbol in the library to attach to. But I’ll keep this example simple to communicate the concept.
Read more...