Understanding the ActionScript Language > About scripting in ActionScript > About planning and debugging scripts |  |

About planning and debugging scripts

Before you begin writing scripts, formulate your goal and understand what you want to achieve. This is good practice whether you want to achieve something simple such as a button that opens a new Web page, or something complex such as an entire Flash Web site. Planning your scripts is as important as developing storyboards for your work. Start by writing out what you want to happen in the movie, as in this example:

| I want to create my whole site using Flash.
| Site visitors will be asked for their name, which will be reused in messages throughout the site.
| The site will have a draggable navigation bar with buttons that link to each section of the site.
| When a navigation button is clicked, the new section will fade in at the center of the Stage.
| One scene will have a contact form with the user's name already filled in.

When you know what you want, you can use the ActionScript that you need to accomplish the tasks.

Getting scripts to work the way you want takes time—often more than one cycle of writing, testing, and debugging. The best approach is to start simple and test your work frequently. When you get one section of a script working, choose Save As to save a version of the file (for example, myDoc01.fla) and start writing the next section. This approach will help you identify trouble spots efficiently and ensure that your ActionScript is solid as you begin to write more complex scripts.

For more information, see Testing a movie.