Graphics Programs Reference
In-Depth Information
Flash uses event handlers to detect and translate events to create a response to the
action. Here is a simple event: a user clicks with the mouse on a button. This is an
external event. If the button contains the event handler onRelease , it will detect the
click. The Flash file responds to the user by going to another frame. Let's experiment
with events to create interactive motion. The motion will create an illusion of depth.
Exercise 4.1: Parallax Scrolling Using ActionScript
Step 1: Getting started
Open the file 4_1_parallaxCode.fla in the Chapter 4 folder. This Flash movie contains
the artwork you need to complete this exercise. The Timeline has one layer labeled sky .
This exercise will create parallax scrolling using vector artwork. The movement will be
controlled through ActionScript. A completed version is provided in the Chapter 4 folder
on the CD. To see the finished results, locate and play 4_1_parallaxCode_DONE.swf
(Figure 4.1).
Figure 4.1 Finished parallax scrolling (4_1_parallaxCode_DONE.swf)
Step 2: Create a new layer and add artwork
Create a new layer above the sky layer. Rename it to background . If the Library is not
visible, open it (Window > Library). Click and drag the waves movie clip symbol to the
background layer. This is vector-based art and has matching endpoints for scrolling.
Search WWH ::




Custom Search