The 1 frame movie

 
     
 

Back

Next

 
     
 

Click on frame 1 of the labels layer.

Select the text tool from the toolbar and use it to draw a text box on the stage to the right of the soldier image.

Look down at the properties pane and set the text properties to a suitable font, size 20, suitable colour, Multiline, Dynamic Text and finally with labelText in the Var: box.

By setting the text box type to Dynamic Text, the box will display the value of a variable called labelText, automatically updating it whenever the variable's value changes.

 
text properties pane
   

A variable is a sort of named box that flash uses to store, display and use values as the movie runs.

The labelText variable will hold a line of text (called a string) that changes as the user points to different parts of the picture.

   

You will now set the starting value for the variable using your first bit of ActionScript. This is a programming language that is used to control the movie as the user interacts with it.

Click on frame 1 of the scripts layer and then press F9. The Actions pane will then appear.

Click on the View Options icon on the right of the pane and select Expert Mode. This lets you type into the pane directly.

Now type the following into the actions box.

view options
   
type into the action pane
   

The first line is a command that instructs the movie to stop running and wait for the user to do something.

The second line creates a variable called labelText and then places the text between the double-quotes into it.

Press F9 again to hide the actions pane. You will see a small letter a in frame 1 of the scripts layer to show that it now contains some actions to be carried out when the movie gets to the frame.

It's about time that you found out if the movie works. Select Control and then Test Movie.

The movie will be compiled and then displayed in the Flash player window. If everything is going according to plan, you will see your text displayed in the text box. If there is a problem with the ActionScript, a helpful window will appear stating Flash's best guess as to the problem.

   
 
     
 

Back

Next