Looking at Methods and Properties

A class consists of methods and properties, you saw in the previous section. Again, methods are functions associated with that object's class, such as the Sound class, and are used to do something with the object. There are built-in methods in the ActionScript 2.0 language for the built-in classes you learned about earlier. For example, setRGB() is a built-in method of the Color class. This method sets the hexadecimal color value for an instance you have in your SWF file.

Properties are also built into the classes that come with ActionScript 2.0 and Flash 8 Basic. Properties are like variables or data used to define the physical structure of an instance, a lot like the variables you use in your SWF file. Take, for example, the code you looked at in Lesson 6:

myMovieClip_mc._visible = true;

In this code, _visible is a property that is used to define whether an instance is visible (TRue) or invisible (false). As you can tell, the visibility property is being defined for the myMovieClip_mc instance on the Stage.


Events and event handlers are discussed later in this lesson in the example called "Using Events and Handlers."

Macromedia Flash 8. Training from the Source
Macromedia Flash 8: Training from the Source
ISBN: 0321336291
EAN: 2147483647
Year: 2004
Pages: 230
Authors: James English

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net