If you have to document additional information that does not fit into the documentation
comments, use implementation comments (in the format of block comments or single-line
comments, as described in
you add them, directly follow the declaration.
Do not include comments that do not directly relate to the class being read. For example,
do not include comments that describe the corresponding package.
The following exercise is part of
do not wish to progress through the example, you can download the class files from
www.helpexamples.com/flash/learnas/classes/.
To document your class files:
1.
Open ClassA.as and ClassB.as in the Flash authoring tool.
2.
Modify the ClassA class file and add the new code to the top of the class file (the changes
to make appear in boldface):
/**
ClassA class
version 1.1
6/21/2005
copyright Macromedia, Inc.
*/
class com.macromedia.utils.ClassA {
private static var _className:String = "ClassA";
public function ClassA() {
trace("ClassA constructor");
}
public function doSomething():Void {
trace("ClassA - doSomething()");
}
}
The code above added a comment to the top of the class file. It's always a good idea to add
comments to your ActionScript and Flash files so that you can add useful information
such as the author of the class, date last modified, copyright information, or any potential
issues/bugs that may be present in the file.
3.
Add a similar comment to the top of the ClassB.as ActionScript file, changing the class
name and any other information as you see fit.
4.
Save both ActionScript files before you proceed.
"About comments" on page
"Example: Writing custom classes" on page
131). Implementation comments, if
Example: Writing custom classes
263. If you
275
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?