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
.
NO
TE
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.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...