Curly Braces


Curly braces are a special set of operators that can be employed in a number of ways. Their use is somewhat difficult to explain all at once, so I'll get your feet wet here. Then, as we go on, you'll see curly braces used in several different ways. As your understanding of programming grows, so will your understanding of the curly braces. To begin, let me say it like this: Curly braces define what is commonly called a code block. A code block is, as its name implies, a chunk of script that is set apart from the rest. It is common to have a keyword or keyword expression in front of a set of curly braces, and you'll see examples of this in the next few sections with regard to conditional statements and loops . A code block also defines a level of scope, the explanation of which is defined in Chapter 3 in the section titled "Scope." Further, curly braces are used to define the body of a function, and in a similar way, they are used to define the body of an event handler. Finally, curly braces can be used to initialize an object by acting as the object initialization operator. Each of these uses will become clear when you see explanations and examples of them further down the line.




Macromedia Flash MX 2004 Game Programming
Macromedia Flash MX 2004 Game Programming (Premier Press Game Development)
ISBN: 1592000363
EAN: 2147483647
Year: 2004
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net