• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Chapter 16. Objects

by Darrel Plant

In this chapter

Understanding How an Object Works

Types of Objects

Methods and Properties

Creating and Deleting Objects

Creating and Working with Array Objects

Manipulating Movie Clip Objects

Troubleshooting Objects

Did You Know?

Modern programming languages are built around the concept of the object, and ActionScript is no exception. An object is an organized set of data in the computer's memory. The key to using objects is organization. When an object is created, it's assigned a type (or class, in programming parlance), and all objects of the same type work in the same way. They might act differently due to varying circumstances, but they share characteristics with each other.

Objects can be arranged in hierarchies, with objects contained inside other objects contained inside other objects. In Flash, the movie is an object, and all the data in the movie that draws graphics, plays sounds, and stores scripts is contained inside that object. This creates a structure that looks very similar to a file directory in list format, and it can be seen in the Movie Explorer window in Figure 16.1, where the arrows in the display and indentation of items in the list indicate which objects are contained inside others.

Figure 16.1. The Movie Explorer shows how objects are nested inside other objects in the movie structure.

When an instance of object B is contained inside an instance of object A, object A's instance is said to be the parent of object B's instance, and B is A's child. The full name of any object consists of the names of a child object and all its parents:


This address points to an instance of an object named hex4, which is inside the object hexfield, which is in the _root timeline of a Flash movie. The dot character (.) separates the names of objects from each other.


The dot separator in Flash 5 is equivalent to the slash (/) in Flash 4 and earlier. They can be used interchangeably in most cases. Slash notation is deprecated and might not be supported by future versions of the Flash Player.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint