This is an example of tween animation, there are many reasons you may want to animate with script rather than the timeline, personally I prefer to use script where possible so that if I should later want to change the animation it requires a lot less effort than editing a timeline. This can be especially painful if you have many animations on the same timeline for example.
Here is some super simple sample code that simply fades a movie clip with an instance name of ‘mcBlock’ over a period of two seconds when you click on a movie clip with the instance name of ‘mcFadeButton’.
———– code sample
myTween = new Tween(mcBlock, “alpha”,None.easeNone,1,0,2,true);
———– end code sample
I will save explaining the various parameters of the Tween to the help file in Flash. But briefly what I have going on here is this…
myTween = new Tween(instance name on the stage, “text string of the property to animate“,easing class,starting value,ending value,time in seconds,boolean to say seconds rather than milliseconds);