Penner AS2 ProFMX: MotionCamera Example

| | Comments (0)


Click around above and then let go, whatever motion you created will be repeated until you start clicking again. This is an example using the MotionCamera class from the Chapter 13 Penner AS2 post

To replicate this example, add an oval shaped MovieClip to the stage with an instance name of "oval".
Then on the root timeline add the following code:

import com.robertpenner.effects.MotionCamera;
 
var xmouse_cam:MotionCamera = new MotionCamera (oval, "_xscale");
var ymouse_cam:MotionCamera = new MotionCamera (oval, "_y");
 
xmouse_cam.setActor (this, "_xmouse");
xmouse_cam.looping = true;
ymouse_cam.setActor (this, "_ymouse");
ymouse_cam.looping = true;
 
this.onMouseDown = function () {
 	with (xmouse_cam) {
  		eraseFilm();
  		rewind();
  		start();
  		startRecord();
  	}
 	with (ymouse_cam) {
  		eraseFilm();
  		rewind();
  		start();
  		startRecord();
  	}
};
 
this.onMouseUp = function () {
 	with (xmouse_cam) {
  		stopRecord();
  		cutFilm();
  		rewind();
  	}
 	with (ymouse_cam) {
  		stopRecord();
  		cutFilm();
  		rewind();
  	}
};
 
stop();


Categories

Leave a comment

June 2008

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

Categories

Archives