At its most basic, the grammar of ActionScript 3.0 is a series of statements and organizational structures. You write code in a plaintext file, optionally using spaces, tabs, and newlines as desired to improve readability.
ActionScript code is kept in ActionScript files, generally called class files because they generally contain one public class. These are plaintext files that you edit in your text editor or IDE, as discussed in Chapter 1, "Introducing ActionScript 3.0." The naming and organization of these files depend on their package structure, which you'll learn about in Chapter 4, "Object Oriented Programming."
When using ActionScript 3.0 within Flash Professional, in addition to using class files, you can add code to a timeline. This is a separate way to edit code that doesn't require external files. I won't cover this technique ...