Graphics Programs Reference
In-Depth Information
4
Programming Depth:
Interactive Movement
The previous chapter explored how animation enhances the illusion of depth. Motion
tweens were used in Flash to create parallax scrolling and to simulate camera move-
ments. This chapter explores using ActionScript to add interactivity to your Flash files.
ActionScript is Flash's programming language. It allows you to create a variety of
interactions, from simple to complex.
ActionScript uses object-oriented programming (OOP). Objects are the types of data
that Flash can store. Examples of objects include graphics, sounds, and text. Objects
belong to a larger group called a class. Examples of classes include the MovieClip
class, Sound class, and Math class. Each object and class has a unique set of properties
that can be accessed, controlled, and altered through ActionScript.
This chapter focuses on the MovieClip class and its properties such as _width . The
exercises will incorporate ActionScript to create interactive parallax scrolling and
camera movements. When you have finished reading the chapter, you will be able to
• Describe objects, classes, properties, and methods
• Construct ActionScript code for specific events
• Create interactive movement in Flash
• Reproduce camera movements using ActionScript
The Main Event
Flash is event-driven. Events can be external or internal. External events are the ways
that the user interacts with the file. Examples of external events include clicking with
the mouse, moving the mouse, and pressing a key on the keyboard. The user does not
have control over internal events, which can be the playback marker leaving one frame
to play the next or the completion of a sound.
Search WWH ::




Custom Search