PDA

View Full Version : REUSABLE:EaseIn > Pause > EaseOut (easing equations and Timer question)


Flashter2
07-20-2005, 05:52 PM
okay, I am working on developing a script that can be used for multiple MC's in the flash file. I need to create a non-frame based reusable piece of code that defines the variables including ease in for (x) seconds, pause for (x) seconds, ease out for (x) seconds. Sound will be applied to each movie clip and i need to have a piece of code that can vary depending on the time of the audio. make sense?

(1) Easing equations to ease the movie in (motion & alpha)

(2) Some timer equation or loop to define time for pause

(3) Easing equations to east the movie out (motion & alpha)

So if i have a sound file (vocal interview) and a couple of images fading in and out, i need to have a piece of code that i can just define the variables for (1, 2, 3) that coinsides with the time of the audio:

(ex: audio = 45 seconds, fade in and slide right with strong easing for 10 sec, pause the animation but not the sound for 25 sec, fade out and ease left for 10 seconds). variables = (fadein, strong, fly, right, 10)(pause, 25)(fadeout, strong, fly, left, 10).

HELP!! time sensative.. any input appreciated.

smagee12
07-27-2005, 01:35 AM
k = elapsedTime/duration; // k = 0-1
k = k*k*(3-2*k); // apply easing
_x = start + (target - start)*k;

This is a very basic ease out- to ease in algorithim. You can do it with alpha or anything for t hat matter, and you can completely control the time of the motion.

pixelwit
07-27-2005, 05:07 PM
Here (http://www.actionscripts.org/tutorials/intermediate/Tweening/index.shtml) is my favorite easing tutorial.

-PiXELWiT
http://www.pixelwit.com