Below is a very simple Flash program. This is a program from our faucet movie (which you can see on the introduction to programming page. Below the program is an explanation of the program's structure.

This code is the program for a flash 'button.' In our faucet example, the buttons are the knobs on the faucet. Below is a breakdown of the structure of this program.
| Part of Program | Function | Syntax |
|---|---|---|
| Action | A specific kind of function that is triggered by some other event. For example, a mouse click. | on (release) |
| Argument | A piece of information the function uses as it executes. For instance, the gotoAndPlay function featured above looks at the argument 10 to see which frame to which it should move. | gotoAndPlay(10); |
| Variable | A variable is a placeholder for a piece of information. Think of it like a mailbox: it has a label, and it has contents. Variables can hold numbers or they can hold strings (groups of letters and numbers). For more, see our page about variables. | if (flow < 3 ) { |
| Expression | An expression is basically a tiny math problem. Flash solves the problem and returns a one or a zero (yes or no). To see more about expressions, see the page about operators. | if (flow < 3 ) { |
| Control Structure | A control structure is a conditional statement that evaluates an expression and decides whether or not to execute code inside a loop. Our example above, for instance, executes its code if the variable flow has a value less than 3. Some other control structures include: else, else if, and for. | if ( flow < 3 ) { ... } |
| Loop | A loop is a way of executing the same code several times or of excluding code. Essentially, it is an area, marked by braces, that is executed (or not) if its control structure says it should be. For instance, in our function above, the control structure ("if") would say that we should execute the gotoAndPlay code if the expression ("flow < 3") yields a "yes" answer. | if ( flow < 3 ) { ... } |