Naming and Calling Methods

   

Naming and Calling Methods

After you've created a new object, you can call its methods. You call a method by using the object's instance name , followed by a dot, then the method. In Normal mode, in the Actions panel's toolbox, simply select the method of that specific object to call its method. For example:

 newDate = currentDate.getMinutes(); 

There are three ways in which the Actions panel displays methods, depending on which method you choose. The method may need to have the object parameters defined (see Figure 14.1). In this case, simply type in the object name within the parameters pane.

Figure 14.1. This method needs an object name.

graphics/14fig01.gif

The method may need both an object and parameters specified (see Figure 14.2). You must provide an object name and the required parameters in the Parameters pane.

Figure 14.2. This method needs an object name and parameters defined.

graphics/14fig02.gif

The method may appear as part of an expression (see Figure 14.3). Here, you must provide the object name before the period.

Figure 14.3. This method is part of an expression.

graphics/14fig03.gif


   
Top


Certified Macromedia Flash MX Designer Study Guide
Certified Macromedia Flash MX Designer Study Guide
ISBN: 0321126955
EAN: 2147483647
Year: 2001
Pages: 142

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