Search code examples
actionscript-3tweengsap

Tweening blur on text using Greensock in AS3


I'm trying to yoyo a bit of text from being blurred to non-blurred back to blurred. For this I've tried to set the blurX and blurY before the tween, but this stops the tween from happening altogether. Am I doing something wrong?

TweenMax.set(text, {alpha:0, blurFilter:{blurX:20, blurY:20}});
TweenMax.to(text, 5, {alpha:1, blurFilter:{blurX:0, blurY:0}, ease:SlowMo.ease.config(1, 0, true), yoyo:true});

EDIT: Removing the ease lets the fade happen, but it still does not yoyo

TweenMax.to(text, 5, {alpha:1, blurFilter:{blurX:0, blurY:0}, yoyo:true});

Solution

  • Forgot to put in the repeat function:

    TweenMax.to(text, 5, {alpha:1, blurFilter:{blurX:0, blurY:0}, repeat:1, yoyo:true});
    

    For smoother easing (the ease works in this case for some reason, whereas didn't in the above scenario):

    TweenMax.to(text, 5, {ease:SlowMo.ease.config(1, 0), alpha:1, blurFilter:{blurX:0, blurY:0}, repeat:1, yoyo:true, delay:(8)});