EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Creating Interactivity and Visual Effects

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
566 Creating Interaction with ActionScript
Creating interactivity and visual effects
To create interactivity and other visual effects, you need to understand the following
techniques:
“Creating a custom mouse pointer” on page 566
“Getting the pointer position” on page 567
“Capturing keypresses” on page 569
“Setting color values” on page 572
“Creating sound controls” on page 573
“Detecting collisions” on page 576
“Creating a simple line drawing toolon page 578
Creating a custom mouse pointer
A standard mouse pointer is the operating systems on-screen representation of the position of
the users mouse. By replacing the standard pointer with one you design in Flash, you can
integrate the users mouse movement within the SWF file more closely. The sample in this
section uses a custom pointer that looks like a large arrow. The power of this feature, however,
is your ability to make the custom pointer look like anything—for example, a football to be
carried to the goal line or a swatch of fabric pulled over a chair to change its color.
To create a custom pointer, you design the pointer movie clip on the Stage. Then, in
ActionScript, you hide the standard pointer and track its movement. To hide the standard
pointer, you use the
hide() method of the built-in Mouse class (see hide (Mouse.hide
method) in the ActionScript 2.0 Language Reference).
To create a custom pointer:
1. Create a movie clip to use as a custom pointer, and place an instance of the clip on
the Stage.
2. Select the movie clip instance on the Stage.
3. In the Property inspector, type cursor_mc in the Instance Name text box.

Table of Contents

Related product manuals