MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 298

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

About calling built-in object methods
You call an object's method by using the dot (
) operator followed by the method. For
.
example, the following code creates a new Sound object and calls its
method:
setVolume()
var my_sound:Sound = new Sound(this);
my_sound.setVolume(50);
For examples of working with methods of the built-in MovieClip class, see
Chapter 11,
"Working with Movie Clips," on page
351. For examples of working with methods of the
built-in TextField, String, TextRenderer, and TextFormat classes, see
Chapter 12, "Working
with Text and Strings," on page
381.
About class (static) members
Some built-in ActionScript classes have class members (static members). Class members
(properties and methods) are accessed or invoked on the class name, not on an instance of the
class. Therefore, you don't create an instance of the class to use those properties and methods.
For example, all the properties of the Math class are static. The following code invokes the
method of the Math class to determine the larger of two numbers:
max()
var largerNumber:Number = Math.max(10, 20);
trace(largerNumber); // 20
For more information on static methods of the Math class, and examples of using them, see
Math in the ActionScript 2.0 Language Reference.
Excluding classes
To reduce the size of a SWF file, you might want to exclude classes from compilation but still
be able to access and use them for type checking. For example, you might want to do this if
you are developing an application that uses multiple SWF files or shared libraries, especially
those that access many of the same classes. Excluding classes helps you avoid duplicating
classes in those files.
For more information on excluding classes, see the following topics:
"Preloading class files" on page 299
298
Classes

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents