mx.transitions.Tween | +--com.robertpenner.effects.MotionCamera
A MotionCamera instance can record the movement of a single "actor" property onto its own "film". It can then play it back, to the same property (the actor) or to a different property.
ActionScript 2.0; Flash Player 6
Property summary
Property | Description |
---|---|
actor:Object |
The actor to be targetted by the MotionCamera. |
actorProp:String |
The actor's property to be targetted by the MotionCamera. |
film:Array |
The film of the MotionCamera. |
filmString:String |
The film of the MotionCamera as a comma-delimited list. |
mode:String |
The current mode of the MotionCamera. |
duration:Number |
The duration of the tweened animation in frames or seconds. |
finish:Number |
The last tweened value for the end of the tweened animation. |
FPS:Number |
The number of frames per second of the tweened animation. |
position:Number |
The current value of the target movie clip's property being tweened. |
time:Number |
The current time within the duration of the animation. |
Event summary
Event | Description |
---|---|
onMotionChanged = function() {} |
Event broadcast with each change in the tweened object's property that is being animated. |
onMotionFinished = function() {} |
Event broadcast when the Tween object finishes its animation. |
onMotionLooped = function() {} |
Event broadcast when the Tween object loops. |
onMotionResumed = function() {} |
Event broadcast when the Tween.resume() method is called, causing the tweened animation to resume. |
onMotionStarted = function() {} |
Event broadcast when the Tween.start() method is called, causing the tweened animation to start. |
onMotionStopped = function() {} |
Event broadcast when the Tween.stop() method is called, causing the tweened animation to stop. |
Method summary
Method | Description |
---|---|
startRecord() : Void |
Turns the MotionCamera's recording mode on. |
stopRecord() : Void |
Turns the MotionCamera's recording mode off. |
cutFilm(t:Number) : Void |
Cuts the film to a specific length. |
eraseFilm() : Void |
Blanks out the film. Effectively clears the data. |
getPosition(t:Number) : Number |
Returns the position at a specified time. |
setActor(actor:Object, actorProp:String) : Void |
Sets the actor and actor's property to be targetted by the MotionCamera. |
continueTo(finish:Number, duration:Number) : Void |
Instructs the tweened animation to continue from its current value to a new value. |
fforward() : Void |
Forwards the tweened animation directly to the end of the animation. |
nextFrame() : Void |
Forwards the tweened animation to the next frame. |
prevFrame() : Void |
Directs the tweened animation to the frame previous to the current frame. |
resume() : Void |
Resumes a tweened animation from its stopped point in the animation. |
rewind() : Void |
Rewinds a tweened animation to the beginning of the tweened animation. |
start() : Void |
Starts the tweened animation from the beginning. |
stop() : Void |
Stops the tweened animation at its current position. |
toString() : String |
Returns a summarization of the MotionCamera instance. |
print() : Void |
Traces a comma-delimited list of the film to the Output window. |
yoyo() : Void |
Instructs the tweened animation to play in reverse from its last direction of tweened property increments. |
var xCam:MotionCamera = new MotionCamera(this, "_x", 0);
obj:Object
- The object which the MotionCamera targets.
prop:String
- The name of the property (in obj) that will be affected.
duration:Number
- The length of time of the motion; set to infinity if negative, 0 or omitted.
Creates an instance of the MotionCamera class.
xCam.startRecord();
Nothing.
Turns the MotionCamera's recording mode on.
xCam.stopRecord();
Nothing.
Turns the MotionCamera's recording mode off.
xCam.cutFilm();
t:Number
- A specific point in time to cut the film; uses the current time if left blank.
Nothing.
Cuts the film to a specific length.
xCam.eraseFilm();
Nothing.
Blanks out the film. Effectively clears the data.
trace (xCam.getPosition());
t:Number
- The time to check the object's position; set to the current time if omitted.
The position.
Returns the position at a specified time.
trace (xCam.setActor(this, "_y"));
actor:Object
- The actor to be targetted by the MotionCamera.
actorProp:String
- The actor's property to be targetted by the MotionCamera.
Nothing.
Sets the actor and actor's property to be targetted by the MotionCamera.
myTween.continueTo(myFinish, myDuration);
finish:Number
- A number indicating the ending value of the target object property that is to be tweened.
duration:Number
- A number indicating the length of time or number of frames for the tween motion.
Nothing.
Instructs the tweened animation to continue from its current value to a new value.
myTween.fforward();
Nothing.
Forwards the tweened animation directly to the end of the animation.
myTween.nextFrame();
Nothing.
Forwards the tweened animation to the next frame.
myTween.prevFrame();
Nothing.
Directs the tweened animation to the frame previous to the current frame.
myTween.resume();
Nothing.
Resumes a tweened animation from its stopped point in the animation.
myTween.rewind();
Nothing.
Rewinds a tweened animation to the beginning of the tweened animation.
myTween.start();
Nothing.
Starts the tweened animation from the beginning.
myTween.stop();
Nothing.
Stops the tweened animation at its current position.
trace (xCam.toString());
trace (xCam);
Returns a summarization of the MotionCamera instance.
Returns a summarization of the MotionCamera instance.
xCam.print();
Nothing.
Traces a comma-delimited list of the film to the Output window.
myTween.yoyo();
Nothing.
Instructs the tweened animation to play in reverse from its last direction of tweened property increments.
myTween.onMotionChanged = function() {
// ...
};
Nothing.
Event broadcast with each change in the tweened object's property that is being animated.
myTween.onMotionFinished = function() {
// ...
};
Nothing.
Event broadcast when the Tween object finishes its animation.
myTween.onMotionLooped = function() {
// ...
};
Nothing.
Event broadcast when the Tween object loops.
myTween.onMotionResumed = function() {
// ...
};
Nothing.
Event broadcast when the Tween.resume() method is called, causing the tweened animation to resume.
myTween.onMotionStarted = function() {
// ...
};
Nothing.
Event broadcast when the Tween.start() method is called, causing the tweened animation to start.
myTween.onMotionStopped = function() {
// ...
};
Nothing.
Event broadcast when the Tween.stop() method is called, causing the tweened animation to stop.
xCam.actor = this;
The actor to be targetted by the MotionCamera.
xCam.actorProp = "_y";
The actor's property to be targetted by the MotionCamera.
xCam.film = [24, 53, 62, 59, 86, 23, 123];
The film of the MotionCamera.
xCam.filmString = "24, 53, 62, 59, 86, 23, 123";
The film of the MotionCamera as a comma-delimited list.
trace (xCam.mode);
The current mode of the MotionCamera.
trace (myTween.duration);
The duration of the tweened animation in frames or seconds.
trace (myTween.finish);
The last tweened value for the end of the tweened animation.
trace (myTween.FPS);
The number of frames per second of the tweened animation.
trace (myTween.position);
The current value of the target movie clip's property being tweened.
trace (myTween.time);
The current time within the duration of the animation.