PDA

View Full Version : How to achieve camera shake?


ductonius
06-24-2005, 06:42 PM
I'm wondering if there is an easy way to achieve a camera shake effect without resorting to dozens of minute motions applied to every image (which would be extremly time consuming and difficult).

The specific effect I need is to have the camera shake up and down like at races when cars flash past.

Any help would be appreciated.

Ruben
06-26-2005, 03:30 PM
Well using png's (with transparency) with blur might do the trick, though it'd be slightly time-consuming to do that I guess...however I don't really know what kind of movie you want to apply it to

:confused: - Ruben

LJK
06-26-2005, 05:36 PM
Hi -
I've used this on movie clips or groups from text, but it might actually work for the entire timeline - not sure:
this._y = Math.random()*3;
//or play with the _x, or setup a variable for when those cars are going by in order to trigger the action...

Good luck,
El

Ruben
06-26-2005, 06:28 PM
this._y = Math.random()*3;Ahh why didn't I think of that..;)

Anyway, this would probably be the best way to apply it:

// this is the function:
function shakeIt(){
if (_root.doShake){
_root._x = Math.random()*3;
_root._y = Math.random()*3;
}else{
delete onEnterFrame;
}
}

// this is how you trigger it:
onEnterFrame = shakeIt;
_root.doShake = true;

// this is how you disable the function:
_root.doShake = false;

:) - Ruben