•General naming guidelines- Keep your names short and sweet.
•Avoiding reserved words and language constructs- When naming instances and variables, avoid using reserved words, which can cause errors in your code.
•Naming variables-Do not begin variable names with numbers.
•Naming constants-You can use constants for situations in which you need to refer to a property whose value never changes.
•Naming Boolean variables-Start Boolean variables with the word "is".
•Naming functions and methods-Use descriptive names,and name methods as verbs.
•Naming classes and objects- Begin a class name with an uppercase letter.
•Naming packages- It's common for package names to use "reverse domain" naming convention.
•Naming interfaces- Starting interface names with an uppercase "I" helps you distinguish an interface from a class.
•Naming custom components- Component names have an uppercase first letter, and any concatenated words are written in mixed case.
•Writing good comments- Always leave good comments, they make people feel better about themself.
•Adding comments to classes- You use documentation comments to describe the code's specifications, but not the implementation.
•Keeping your ActionScript code in one place- Keep your actionscript code in one place, so you can edit it at any time. And so its easy to find.
•Attaching code to objects-You must avoid attaching ActionScript code to objects in a FLA file, even in simple or prototype applications.
•Handling scope-Scope is the area where the variable is known and can be used in a SWF file, such as on a timeline, globally across an application, or locally within a function.
•Structuring a class file- It takes your actionscript 2.0 and exports as a flash video.(SWF)
•About using functions- If you are using ActionScript 2.0, avoid writing functions on a timeline.
•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.
•Writing conditional statements- Place conditions on separate lines in if, else..if, and if..else statements.And use braces ({}) for if statements.
•Writing compound statements- Compound statements contain a list of statements within braces ({}). The statements within these braces are indented from the compound statement.
•Writing a for statement- Just put // to write a statement in flash code.
•Writing return statements- Don't use parentheses [()] with any return statements that have values.
•Writing switch statements- All switch statements include a default case.
•About using listener syntax- You can write listeners for events in several ways in Flash 8 and later.
Weekly Post for 5/3/12
12 years ago