Skip to nav

Flash Tutorial – AS Coding standards (Good coding guide)

ActionScript Coding Standards

Macromedia Flash applications have generally been built without regard to particular standards or guidelines. While this flexibility allows for a wide variety of solutions to a problem, it also makes it difficult for anyone other than the author of an application to understand the code. Even the author may have difficulty reading his or her own code after it is written. If a developer cannot understand the code in an application, it will not be easy to debug the code, make changes, or reuse.

This documents outlines a system of best practices specifically designed for coding with ActionScript and building applications with Macromedia Flash. Applications that use these guidelines should be more efficient and understandable-and the underlying ActionScript code will be easy to debug and reuse.

Naming guide lines

Most importantly, an application’s naming scheme must be consistent and names should be chosen for readability. This means that names should be understandable words or phrases. The primary function or purpose of any entity should be obvious from its name. Since ActionScript is a dynamically typed language, the name should also contain a suffix that defines the type of object being referred to by the name. In general, “noun-verb” and “adjective-noun” phrases are the most natural choice for names.

For Example

Movie name – my_movie.swf

entity appended to a URL – course_list_output

component or object – ProductInformation

variable or property – userName

Function names and variables should begin with a lower case letter. Objects, and object constructors, should be capitalized. Using mixed case is also recommended when naming variables, although other formats are acceptable as long as they are used consistently within the application.

Variable names can only contain letters, numbers and underscores. However, do not begin variable names with numbers or underscores.

Examples of illegal variable names
Read more at adobe

Line Break

Author: Doug Banks (94 Articles)

Hi, my name is Doug, Creative Director at Pixel Design Studio. I have over 10 years experience in project management and the designing and building of websites. I am proficient in XHTML, HTML5, CSS, jQuery, JS, PHP, ASP.NET and Flash development.

2 Comments to “Flash Tutorial – AS Coding standards (Good coding guide)”

  1. There is some really great stuff here!

  2. that’s a stellar number. and keep in mind if you are using a wordpress weblog prefer a lot of are these days there are some stellar plugins to consider proper care of this lot. my favorite seo plugin is seo platimum

Leave a Reply

The Cloud