Good day!
To create an ordinary banner in Flash, basically, you only need animation skills and knowledge of AS1, so that where you need to put stop (); or follow the link getURL () ;, and usually this is enough. But if the customer asks to make a mini cartoon inside the banner, and even a raster image is present, and at the same time, the administrators of the site where the banner will be placed, put a limit of 20 kb on it. Use multiple layers with Motion tween and Shape tween, objects in the library, etc. Due to all this, the banner volume exceeds the allowed quota.
Below we will get rid of tweenes on our stage and describe all movements using the TweenLite class (used with AS2, AS3).
')
First we need to decide how we will work with the code, there are two ways here:
- Creating a separate class with code (for example: tween.as).
- Using one of the frames of the scene where our code will be stored.
one.
In this case, it will be necessary in our video, in the first frame of the scene to register #include "tween.as". Create a tween.as class. Inside the class itself will be something like this:
//
import gs.TweenLite;
import gs.easing.*
//
class tween extends MovieClip
{
//
private var mc:MovieClip;
public var mc_:MovieClip;
//
public function tween1(){}
private function tween2(){
}
We will not focus on this path and make it easier.
2
I just want to warn you that all the objects that are on the stage are pre-defined names. In the created clip in the first frame we write:
//
import gs.TweenMax;
import gs.easing.*
//
TweenLite.to(mc, 1, {_x:1, _y:1, _xscale:1, _yscale:1, _rotation:0, _alpha:100, tint:0x000000, ease:Back.easeOut});
TweenLite.to (clip name, skorost_animatsii {polozhenie_klipa_na_stsena_po_x_v_kontse_animatsi, polozhenie_klipa_na_stsena_po_y_v_kontse_animatsi, razmer_kotoryy_primet_obekt_k_kontsu_animatsii_width, razmer_kotoryy_primet_obekt_k_kontsu_animatsii_height, povorot_klipa_ (positive - clockwise, the negative - anti-clockwise), prozrachnost_klipa, tsvet_klipa_k_kontsu_animatsii, ease: Back.easeOut});
The ease item is responsible for the type of motion. There are several types:
- without ease (normal uniform motion)
- Back.easeIn
- Back.easeOut
- Back.easeInOut
- Bounce.easeIn
- Bounce.easeOut
- Bounce.easeInOut
- Circ.easeIn
- Circ.easeOut
- Circ.easeInOut
- Cubic.easeIn
- Cubic.easeOut
- Cubic.easeInOut
- Elastic.easeIn
- Elastic.easeOut
- Elastic.easeInOut
- Expo.easeIn
- Expo.easeOut
- Expo.easeInOut
- Linear.easeNone
- Quad.easeIn
- Quad.easeOut
- Quad.easeInOut
- Sine.easeIn
- Sine.easeOut
- Sine.easeInOut
To create a normal movement from point A to point B, that's enough. If you create a consistent movement, you can simply make a function:
function enableTween():Void
{
TweenLite.to(mc, 1, {_x:1, _y:1, delay:0.0, _xscale:1, _yscale:1, _rotation:0, _alpha:100, tint:0x000000, ease:Back.easeOut});
TweenLite.to(mc, 1, {_x:1, _y:1, delay:0.1, _xscale:1, _yscale:1, _rotation:0, _alpha:100, tint:0x000000, ease:Back.easeOut});
TweenLite.to(mc, 1, {_x:1, _y:1, delay:0.2, _xscale:1, _yscale:1, _rotation:0, _alpha:100, tint:0x000000, ease:Back.easeOut});
}
And run the program in the right place enableTween ();
More information about this class can be found in
this blog . You can also download it there.