Home » ActionScript 2.0, ActionScript 3.0

ActionScript Basics part 2

23 November 2010 No Comment
Share on Facebook

Previous Entries:
ActionScript basics part1

ActionScript basics part2

ActionScript basics part3

ActionScript basics part4

ActionScript basics part5

ActionScript basics part6

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.

GET THE UPDATES VIA EMAIL

We don't share your email anywhere, grab our rss via feedburner


Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.