Formatting Actionscript Syntax - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Formatting ActionScript syntax

Formatting ActionScript 2.0 code in a standardized way is essential to writing maintainable
code, and it's easier for other developers to understand and modify. For example, it would be
extremely difficult to follow the logic of a FLA file that has no indenting or comments, as well
as inconsistent naming conventions and formatting. By indenting blocks of code (such as
loops and
statements), you make the code easy to read and debug.
if
For more information on formatting code, see the following topics:
"General formatting guidelines" on page 764
"Writing conditional statements" on page 767
"Writing compound statements" on page 768
"Writing a for statement" on page 769
"Writing while and do..while statements" on page 770
"Writing return statements" on page 770
"Writing switch statements" on page 770
"Writing try..catch and try..catch..finally statements" on page 771
"About using listener syntax" on page 772
General formatting guidelines
When you use spaces, line breaks, and tab indents to add white space to your code, you
increase your code's readability. White space enhances readability because it helps show the
code hierarchy. Making your ActionScript 2.0 easier to understand by making it more
readable is important for students as well as for experienced users working on complex
projects. Legibility is also important when you are debugging ActionScript code, because it is
much easier to spot errors when code is formatted correctly and is properly spaced.
You can format or write a piece of ActionScript 2.0 code several ways. You'll find differences
in the way developers choose to format the syntax across multiple lines in the ActionScript
editor (the Actions panel or Script window), such as where you put brackets (
parentheses [
]).
()
764
Best Practices and Coding Conventions for ActionScript 2.0
) or
{}

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents