• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Programming Structures > Statements, Expressions, and Operators

Statements, Expressions, and Operators

To quickly review, statements are complete “sentences of code” that usually do something. Expressions are more like “phrases” because they don’t do anything by themselves, but rather are used within statements. Expressions also result in a value when they’re evaluated. For example, if you were to evaluate the expression “slow as molasses,” it would have an actual value (perhaps 1 inch per hour).

It works the same in Flash—the expression price/2 results in a value. Finally, operators, as part of an expression, perform an operation (often math) on one or more operands. For example, the “plus” operator (+) performs the addition operation on two numbers (operands). The expression 2+2 results in a value (4). Finally, the statement quad=2+2 actually does something (namely, assigning the value of 4 to the variable quad). Now that we know the terms, we can explore each concept in detail.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint