Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


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

2.2. Miscellaneous Basics

Some basic topics don’t require a section devoted to their discussion, but should still be mentioned due to their use throughout the book. For example:


Case sensitivity

ActionScript 3.0 is a case-sensitive language, so you have to be careful with capitalization. For example, the keyword true is all lowercase. If you type TRUE or True, in the same context, you will get an error.


Use of the semicolon (;)

The official use of the semicolon in ActionScript is to execute more than one statement on a single line. This is rare in the average script, but we will look at this technique when discussing loops. The semicolon is also used to indicate the end of a line. This is not typically required, but it is recommended for clarity and to ease any possible transition into learning other languages in which the semicolon at the end of a line is required.


Use of trace()

As a means of getting quick feedback in an example, or as a testing and debugging technique when writing scripts, trace() can be very helpful. This instruction places text into the Output panel of the Flash Professional interface. As such, this is an option that is available only when creating your file, and has no use in your distributed SWF. ActionScript 3.0’s version of trace() supports tracing multiple items at once by separating them with commas. These items are then traced with a space separating the content. Typing the following into a script, for example, will display “Learning ActionScript 3.0 Shupe Rosser” in Flash Professional’s Output panel:

trace("Learning ActionScript 3.0", "Shupe", "Rosser");


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial