Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Best Practices and Coding Conventions for ActionScript 2.0 > Naming conventions > Naming functions and methods | |||
Use the following guidelines when you name functions and methods in your code. For information on writing functions and methods, see Functions and Methods.
A good example would be singLoud().
For example, if you are returning the name of a song title, you might name the function getCurrentSong().
ActionScript 2.0 does not permit overloading. In the context of object-oriented programming, overloading refers to the ability to make your functions behave differently depending on which data types are passed into them.
You might concatenate the name, but it should contain a verb. You use verbs for most methods because they perform an operation on an object.
Examples of method names include the following:
sing(); boogie(); singLoud(); danceFast();
|
|
|
|