
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
8
|
Chapter 1: A Gentle Introduction for Nonprogrammers
Here comes the exciting moment—your first line of code. It’s time to introduce your-
self to Flash. Type the following into the Script pane:
var message = "Hi there, Flash!";
That line of code constitutes a complete instruction, known as a statement. On the
line below it, type your second and third lines of code, shown following this para-
graph. Replace
your name here with your first name (whenever you see constant-
width italicized code
in this book it means you have to replace that portion of the
code with your own content):
var firstName = "your name here";
trace (message);
Hmmm. Nothing has happened yet. That’s because our code doesn’t do anything
until we export a .swf file and play our movie. Before we do that, let’s ask Flash to
say hi back to us. Type your fourth line of code under the lines you’ve already typed
(man, we’re really on a roll now . . . ):
trace ("Hi there, " + firstName + ", nice to meet you.");
Okay, Flash is ready to meet you. Select Control ➝ Test Movie, and see what hap-
pens. Some text should appear in the Output window as shown in Figure 1-3.
Pretty neat, eh? Let’s find out how it all happened. To return to editing the .fla
source file, close the window of the .swf file created by our test.
Keeping Track of ...