Graphics Programs Reference
In-Depth Information
Exercise Summary
This exercise deals with external events. The user interacts with the file through the
position of the cursor. Flash detects the cursor's position and moves the layers accord-
ingly. The next exercise simulates depth using keyboard interactions.
Exercise 4.3: Depth Illusion Under User Control
This exercise focuses on another external event—keypress. Flash can detect a key-
press for any key on the keyboard. Here we will use the arrow keys to scale movie
clip instances on the Stage. This scaling will simulate depth. The completed version
is provided in the Chapter 4 folder. Play 4_3_depthIllusion_DONE.swf (Figure 4.20)
to see the finished results. Press the Up Arrow and Down Arrow keys.
Figure 4.20 Finished depth illusion (4_3_depthIllusion_DONE.swf)
Step 1: Getting started
Open the file 4_3_depthIllusion.fla in the Chapter 4 folder on the accompanying
CD. This Flash movie contains the artwork you need to complete this exercise. There
are five layers in the Timeline that contain an instance of a doorway movie clip. Each
doorway has been scaled differently and had its brightness adjusted to create the illu-
sion of perspective. Each instance has been given an instance name: door1_mc to
door5_mc . These names will be referenced through ActionScript to scale the dimensions
of the instance. Always remember to name your instances.
Search WWH ::




Custom Search