Cuyamaca Collegeskip to content
Apply & Enroll
Departments
Help for Students
Find People
Online Services
Campus Information
Student Activities
Graphic Design: 

 
Flash Distraction
of the Week

About the Flash
Video Gallery

GCCCD Blackboard

GD 222
Home
Syllabus
Schedule
News
Labs
Videos
Flash Resources
Web Dev Resources

 

GD 222 Flash Web Animation - Spring, 2009
Online Course
http://www.cuyamaca.edu/jeff.sale/gd222/

Lesson Supplement:
Mouse-tracking

Baro

Example 1: Simple Mouse-tracking: Making a Circle follow the mouse

Download the file for this animation

To create this animation, type the following text into a new Flash document Actionscript panel:

// Create a ball clip
this.createEmptyMovieClip("ball", 0);
ball.lineStyle(50, 0x0, 100);
ball.moveTo(0, 0);
ball.lineTo(0, 1);
// Animate ball to follow the mouse
ball.onEnterFrame = function( ) {
    this._x -= (ball._x - _xmouse) / 4;
    this._y -= (ball._y - _ymouse) / 4;
};

Save your file and test it. Modify some of the other parameters in the script to see how they affect the appearance and interactivity of the animation.

 

Example 2: Tarsier Eye Movement

Download the sample file

3D Tarsier Animation

Download the sample file

 

Jeff Sale

E-mail: jeff.sale (at) gcccd.edu
Phone: 619-660-4000
Fax: 619-660-4399
Graphic Design, Cuyamaca College
You may also reach me at jsale37 (at) gmail.com

 

 

Page footer information

12 Nov 2009 13:54:45 -0800