Image shakin

how do u make a image shake when the mouse if over it

-Tom

how do you want it to shake? left right? circular type thing? up down?

random

// prototype
MovieClip.prototype.shake = function(r) {
	var x = this._x;
	var y = this._y;
	this.onRollOver = function() {
		this.onEnterFrame = function() {
			this._x = x-(r/2)+Math.random()*r;
			this._y = y-(r/2)+Math.random()*r;
		};
	};
	this.onRollOut = function() {
		delete this.onEnterFrame;
		this._x = x;
		this._y = y;
	};
};
// usage
myMovieClip.shake(20);

Like that? =)

that aint workin sumreason wanna whack it in a fla for me so i can see wot im doin

It works. :sigh:

novatake, I just tested it and it does work… just convert your image to a movie clip and name it myMovieClip and put those actions on the first frame of the main timeline

whoops… kax beat me to it
btw, up the frame rate real real high and it looks really cool

:stuck_out_tongue:

You’re so slow, 28!! :wink: =)

cheers guys i forgot bout namin my movie clip lol im a forgetful swine

You’re right about that… :stuck_out_tongue: :wink: jk

I can’t help bein sl… huh?

On a side note, that’s a pretty cool sig there, novatake…

cheers its kinda screwed though u cant see the whole text, which is a ****ter but im workin on it, took me a while to make like, and edit once i got it dont ill be away though lol

Is it a swift3d work or what?

nope just flash, draw the cube in 3d and then duplicate it but each cube is on a different path its alot of script really for each letter to work