[howto] elastic image...action

Hi im working on en site that needs a bouncie image, but all the tuts and movie clip i can find only work with onmouseover effect… i dont want onmouseover but bounce when the clip loads…

maybe someone can rearange this script so it bouces on clipload…

this in the 1st frame:

Movieclip.prototype.elasticScale = function(target, accel, convert) {
	xScale = xScale * accel + (target - this._xscale) * convert 
	yScale = yScale * accel + (target - this._yscale) * convert 
	this._xscale += xScale
	this._yscale += yScale
}

and this in the movie clip:

onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		elasticScale(150, 0.9, 0.1)
	} else {
		elasticScale(100, 0.9, 0.1)
	}
}

please can someone help?

Can’t you just do…

onClipEvent (enterFrame) {
	elasticScale(150, 0.9, 0.1);
}

???

okay i tryed your idea and must laugh :slight_smile:
i always seem to have the bigest codes…

dhamm you juist made my code 2 times smaller :slight_smile:

butt okay back to the code… you solution does work but did’nt give me the effect that i was going for…

i need to give in a minimu point of start and a maximun point of end…

of he jumps up from say 1 to 100% and stops

thats may goal…!!

yesssss… i did it :slight_smile:

dhuuu i was so simple :slight_smile:

i juist made my movie clip very small

thanks for help…~!

Awesome :slight_smile:

I am glad I could help. And don’t worry about using too much code… I have the same problem. I can’t optimize my code for anything.

I can optimize it a bit, but I always seem to miss something that I can optimize :slight_smile:

well, i got a good resources on optimizing ur Actionscript, if it is needed, i would post it as a thread

If it is the one that was posted on bits forum, I already have it :slight_smile:

A lot of it I know how to do, I just overlook it :-\ :stuck_out_tongue:

which one, “flasm”?

Yep :slight_smile:

i think its i need to show you the result :stuck_out_tongue: for al you hard work :slight_smile:

[swf=“http://213.46.31.46/other.designs/sneaknet//flash/cyric_new.swf height=279 width=230”][/swf]

It’s a work in progress… :slight_smile: (use your mouse over the image)
check rest of the site here tell me what you think of it :slight_smile: (oh yeh and dont minde the button menu :slight_smile:

Added a little extra stuff to it, if you wanne see the code ask and i’ll post it :slight_smile:

Thats pretty good. Good job :slight_smile:

One question about the site though… why do you have the name of the link come up next to the name of the link when you roll over it on the main menu?

Like i say, dont minde the buttons… :slight_smile: its a little error in the script :slight_smile:

did’nt get to it yet :slight_smile: bin buzy FLASHING

Oh ok :slight_smile:

Good Luck with everything!