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

Chapter 15. Using Basic ActionScripts > Applying Dot Syntax to a Movie Clip

Applying Dot Syntax to a Movie Clip

When you use dot syntax, you gain control over a Flash ActionScript. For example, you have a movie clip of a car, and the wheels of the car are separate movie clips. In other words, you’ve dragged a movie clip symbol (the wheels), into a movie clip (the car), and you want to use a button to stop and start the wheels movie clip. To do this will require using dot syntax to identify the path to the correct movie clip, and then use the play or stop methods on the wheels.

Use Dot Syntax

1.
Open the file movingCar.fla, and then open the car movie clip symbol in the Flash Library.

See “Real World Examples” on page xviii in the Introduction for information on downloading practice files from the Web.

2.
Create a new layer, and then select the new layer.

3.
Drag the wheel movie clip symbol into the car movie clip, and then place one copy for the front and one copy for the back wheels.

4.
Select and give each of the wheel symbols a unique name in the Property Inspector.

See Also

See Chapter 14, “Using ActionScript Behaviors” on page 321 for additional information on creating scripts in the ActionScript panel.

5.
Return to the Stage, drag the car movie symbol onto the Stage, and then select the symbol.

6.
Give the car movie symbol a unique name in the Property Inspector.

7.
Drag the Play button symbol onto the Stage, and then select the symbol.

8.
Enter the script as shown in the illustration.

IMPORTANT Transportation is the instance name of the car symbol on the Stage, and front wheel and back wheel, are the instances names for the wheel movie clips as defined in the Library.

9.
Drag the Stop button symbol onto the Stage, and then select the symbol.

10.
Enter the script as shown in the illustration.

11.
Click the Control menu, and then click Test Movie.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint