Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Best Practices and Coding Conventions for ActionScript 2.0 | |||
Adobe Flash designers and developers must write code and structure applications in a way that is intuitive and beneficial to themselves as well as to the other people who are working on the same project. This is particularly important in FLA files with lots of assets, or long code files. When you follow best practices and coding conventions, everyone on the design and development team can understand the file structure and ActionScript code and can work more efficiently. This document helps formalize the Flash development and coding process.
Because it is common for more than one designer or developer to work on a single Flash project, teams benefit when everyone follows a standard set of guidelines for using Flash, organizing FLA files, and writing ActionScript 2.0 code. The sections in this chapter outline the best practices for writing ActionScript, and some sections of Using Flash cover best practices when using the Flash authoring tool.
The following guidelines encourage consistency for people learning how to use Flash and write ActionScript code. Adopt best practices at all times, whether you are a designer or developer, or working alone or as part of a team.
Adopting consistent and efficient practices helps you speed up your workflow. It is faster to develop using established coding conventions, and easier to understand and remember how you structured your document when you want to edit it further. Additionally, your code is often more portable within the framework of a larger project, and easier to reuse.
Other people editing the document can quickly find and understand ActionScript, consistently modify code, and find and edit assets.
Multiple authors can work on an application with fewer conflicts and greater efficiency. Project or site administrators can manage and structure complex projects or applications with fewer conflicts or redundancies if you follow best practices and coding conventions.
Learning how to build applications by using best practices and following coding conventions reduces the need to relearn particular methodologies. If students learning Flash practice consistent and better ways to structure code, they might learn the language more quickly and with less frustration.
Consistent techniques and the following guidelines help people learning Flash, or people working effectively in team environments. Consistent methods help you remember how you structured your document when you work by yourself, particularly if you have not worked on the FLA file recently.
These are only a few of the reasons to learn and follow best practices. You are bound to discover many more when you read these best practices and develop your own good habits. Consider the following topics as a guideline when you are working with Flash; you might choose to follow some or all of the recommendations. You can also modify the recommendations to suit the way you work. Many of the guidelines in this chapter help you develop a consistent way of working with Flash and writing ActionScript code.
This chapter covers the following subjects on coding conventions and best practices:
Flash CS3