Object-Oriented Thinking

When programmers talk about object-oriented programming, they're referring to specific programming techniques—a way of looking at the parts of a program and the overall design. The idea is to create chunks of programming code that do a specific job. If you design them all, those chunks can fit together with other pieces of code. Think for a second about a typical home theater system that has an amplifier/receiver, a DVD player, a TV screen, and maybe a cable box. Each unit is an object. The folks who designed the DVD player don't have to know how to build a TV screen; they just have to make a DVD player that can plug into a TV. You can plug the same DVD player into another home theater system, and it'll work perfectly well. Programmers strive for that kind of modularity when they build objects.

The benefits are obvious. As long as the objects have an agreed-upon method for interacting, different programmers can work on different objects. When they all come together, they'll play well with one another. If the objects are truly useful and flexible, you can reuse them in future projects. Future programmers won't have to understand how the DVD player works; all they need to know is how to plug it in and how to send and receive signals from it.

In addition to reusability, there are a handful of other concepts that define object-oriented programming. Some of them don't make a lot of sense until you understand the basics of ActionScript, but here are a few of the ...

Get Flash CS5: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.