General nameing guidelines-Limit Abbreviations by making an abbreviation for only one thing.
Avoiding reserved words and language constructs- keep for using words that can cause errors in your code.
Naming variables-Start words with lower case.
Naming constants-Separate words should contain underscores.
Naming Boolean variables-
Naming functions and methods-Use descriptive names.
Naming classes and objects-Begin a class name with an uppercase letter.
Naming packages-Do not use underscores or dollar sign characters
Naming interfaces-Interface names are usually adjectives
Naming custom components-Components that do not use concatenated words begin with an uppercase letter.
Naming conventions-They make your code readable so that you can immediately identify a variable's data type
Writing good comments-•Use block comments (/* and */) for multiline comments and single-line comments ( // ) for short comments.
Adding comments to classes-Use documentation comments to describe interfaces, classes, methods, and constructors.
Keeping your ActionScript code in one place-Code is easy to debug
Attaching code to objects-ActionScript code that is attached to objects is difficult to debug.
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-5.Add all your static variables. Write the public class variables first and follow them with private class variables.
About using functions-Reusing code lets you create efficient applications and minimize the ActionScript 2.0 code that you must write.
ActionScript and Flash Player optimization-No case sensitivity is involved with the code, only Flash Player.
General formatting guidelines-Put one blank line between paragraphs (modules) of ActionScript.
Writing conditional statements-Place conditions on separate lines in if, else..if, and if..else statements.
Writing compound statements-Place braces around each statement when it is part of a control structure (if..else or for), even if it contains only a single statement.
Writing a for statement-Remember to include a space following each expression in a for statement.
Writing while and do..while statements-You can write do-while statements using the following format:do {//statements} while (condition);
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.
Tuesday, February 2, 2010
Subscribe to:
Post Comments (Atom)
Naming Boolean variables-
ReplyDeletewas missing -10= 90/100