TweenLite is without a questions one of the most powerful Flash tools out there. If you haven’t so far, check it out right now!
Here a example of how to create a blur rollover effect in 30 sec.
Both for the AS2 and AS3 example make sure you have the TweenLite classes in the same folder as your fla (the first folder of the package “com”).
AS2 version:
import com.greensock.*;
btn.onRollOver = btnRollOver;
btn.onRollOut = btnRollOut;
function btnRollOver()
{
TweenMax.to(btn, .6, {blurFilter:{blurX:12, blurY:12}});
}
function btnRollOut()
{
TweenMax.to(btn, .6, {blurFilter:{blurX:0, blurY:0}});
}
In line 1 the necessary TweenLite classes are imported (again, make sure, that the TweenLite package is in the same folder as your fla file).
The events are mapped to the designated function in line 3 and 4.
Inside the functions the tween behavior is applied to the Movieclip “btn” (which needs to be set in the fla file, please consult example fla if unclear). In the function “btnRollOver” a blur transition (both x- and y-wise) with the strength of 8 and a duration of 0.6 sec is applied, where the function “btnRollOut” goes the opposite direction and sets the blur back to 0.
AS3 version:
import com.greensock.*;
btn.addEventListener(MouseEvent.MOUSE_OVER, btnRollOver);
btn.addEventListener(MouseEvent.MOUSE_OUT, btnRollOut);
function btnRollOver(e:Event)
{
TweenMax.to(btn, .6, {blurFilter:{blurX:12, blurY:12}});
}
function btnRollOut(e:Event)
{
TweenMax.to(btn, .6, {blurFilter:{blurX:0, blurY:0}});
}
Basically the same as in the AS2 is happening. However, the mouse event are handled differently in AS3.

1 Comment
It is not TweenLite
Write a Comment