Lesson 4. Using Object Classes

Every day you use objects to perform any number of activities. You may have used Tupperware to store fresh cookies to prevent them from becoming stale, or the trash can to store a fruitcake from your Aunt Sally. Objects are items designed to meet specific needs. You can use them to perform tasks of their own (for example, a VCR playing or recording a movie), or you can employ them as simple storage devices.

Using Macromedia Flash, you can create objects that perform tasks or store something (such as data), in much the same way as real-world objects. As a matter of fact, you'll probably be pleasantly surprised at how familiar Flash objects seem, once you understand basic concepts of how they work. While Flash allows you to create your own kinds of custom objects (a topic we'll cover in Lesson 7, "Creating Custom Classes"), it provides a number of built-in objects (organized in what are known as classes), ready for immediate use in your projects. In this lesson, we'll introduce you to many of these built-in classes of objects, explain their functionality, and help you gain experience using them.

This Flash word processor is one of the projects you'll create in this lesson.

graphics/04inf01.gif

WHAT YOU WILL LEARN

In this lesson, you will:

  • Learn what objects/object classes are and why they are useful

  • Get acquainted with the various classes of objects available in ActionScript

  • Use the Color class

  • Create an interactive scene using the Key object class

  • Create a word processor using properties and methods of the String and Selection object classes

APPROXIMATE TIME

This lesson takes approximately 45 minutes to complete.

LESSON FILES

Starting Files:

Lesson04/Assets/Clown1.fla

Lesson04/Assets/balloon1.fla

Lesson04/Assets/wordProcessor1.fla

Completed Projects:

Clown2.fla

balloon2.fla

wordProcessor2.fla