ActionScript Basics part 2
ActionScript basics part1
ActionScript comments are a way to keep your code clean and easy to read. Comments cannot be rendered because the browsers skip them. Most web designers are probably familiar with HTML comments, which are similar to ActionScriptcomments with the exception of the syntax.
There are two types of comments that you can use in ActionScript: single and multiple line comments. Single line comments are created using two slashes “//” in front of the line of text. Multiple line comment blocks are created by wrapping the text with a slash and an asterisk “/*” and closing the comment block by adding an asterisk and a slash “*/”. In CSS, comments are setup in a similar way with multiple line blocks.
Single line comments:
// This is my first ActionScriptProgram trace(‘This is very cool stuff’);
Multiple line comment block:
/* This is my comment in ActionScript which spans multiple lines */
Comments are a great way to document what your program is doing, but it’s important not to go overboard when adding comments, as they can add unnecessary bloat to your code. Comments will help other designers and developers understand your code. When distributing your code to the open source community, or to those who may not fully understand the ActionScript. comments can be very helpful.