Chapter 16. Objects and classes

 

This chapter covers

  • OO concepts
  • Implementing OO concepts using ActionScript classes
  • Creating your own classes
  • Packages

You should now be equipped with enough knowledge of ActionScript to use it to respond to events, add user interactivity to your application, and manipulate properties. Now it’s time to take those skills to the next level.

In this chapter, we explore a fundamental feature of Flex: objects and classes. We also delve into some OO theory. What you’ll learn will save you considerable development time and render your software easier to maintain.

By the end of this chapter, you’ll have learned how to create objects and classes, invoke and destroy them, and extend those that already exist. This may seem like we’re putting a lot on your plate, but it won’t take more than 30 minutes to learn, and upon completion, you’ll have created a fully functional OO program.

16.1. OO theory in five minutes

Flex is an OO-based application. Therefore, having some understanding of OO programming will be tremendously beneficial toward taking Flex and your designs to a higher plane and resolving issues more quickly. Most important, expanding your knowledge of OO programming will provide the foundation for creating reusable code.

16.2. Playing with objects

16.3. Creating a class

16.4. Working with properties

16.5. Creating methods for your class

16.6. Summary