code:
moveFunction = function()
{
var r = (getTimer() - this.startTime)/this.duration;
// r is an animation variable which will go from 0 to 1 during the animation
if (r > 1) {
r = 1;
delete this.onEnterFrame;
}
// use r here to control each the various things such as _alpha, _rotation, _xscale and _yscale
// for example, if you want _alpha to go from 50 - 100, you would use this:
this._alpha = this.beginAlpha + r * (this.endAlpha-this.beginAlpha);
// similar for _xscale...
this._xscale = this.beginScale + r * (this.endScale - this.beginScale);
this._yscale = this.beginScale + r * (this.endScale - this.beginScale);
// also animate rotation and _x and _y
// using sin,cos,r,amplitude and phase, as I have shown above...
}
// For each movieclip, set up the starttime & duration of the animation
// And the minimum and maximum value of each component
mc.startTime = getTimer();
mc.duration = 15*1000; // 15 seconds
// and set up begin and end values for each parameter you are animating
mc.beginAlpha = 50;
mc.endAlpha = 100;
mc.beginScale = 75;
mc.endScale = 120;
mc.onEnterFrame = moveFunction;