EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Chapter 5: Syntax and Language Fundamentals

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
113
5
CHAPTER 5
Syntax and Language
Fundamentals
Learning ActionScript syntax and statements is like learning how to put together words to
make sentences, which you can then put together into paragraphs. ActionScript can be as
simple. For example, in English, a period ends a sentence; in ActionScript, a semicolon ends a
statement. In the ActionScript language, you can type a
stop() action to stop the playhead of
a movie clip instance or a SWF file from looping. Or you can write thousands of lines of code
to power an interactive banking application. As you can see, ActionScript can do very simple
or very complex things.
In Chapter 4, “Data and Data Types, you learned how the ActionScript language uses data,
and how you can format it in your code. This chapter demonstrates how you can form
statements in ActionScript using syntax. It contains many short code snippets and some
examples to demonstrate fundamental language concepts. Upcoming chapters contain longer
and increasingly involved code examples that combine and facilitate the fundamentals you
learn in this chapter.
The general rules described in this section apply to all ActionScript. Most ActionScript terms
also have individual requirements; for the rules for a specific term, see its entry in the
ActionScript 2.0 Language Reference.
Applying the basics of ActionScript in a way that creates elegant programs can be a challenge
for users who are new to ActionScript. For more information on how to apply the rules
described in this section, see Chapter 19, “Best Practices and Coding Conventions for
ActionScript 2.0,” on page 731.
NOTE
You add ActionScript directly to a frame on the Timeline within this chapter. In later
chapters, you use classes to separate your ActionScript from the FLA file.

Table of Contents

Related product manuals