Application Development Tips and Tricks > Coding conventions > Keeping actions together

 

Keeping actions together

Whenever possible, all code should be placed in one location. This makes the code easier to find and debug. One of the primary difficulties in debugging Macromedia Flash MX movies is finding the code. If most of the code is placed in one frame, this problem is eliminated. Usually, the best place to put the code is in frame 1.

When large amounts of code are located in the first frame, make sure you separate sections with comments to ensure readability, as follows:

/*** Button Function Section ***/

/*** Variable Constants ***/