views:

95

answers:

1

i can't seem to tween any bitmap filters. here's my code:

var dropShadow:DropShadowFilter = new DropShadowFilter();
mySprite.filters = [dropShadow];
var dropShadowTween:Tween = new Tween(dropShadow, "distance", Regular.easeOut, 4.0, 20, 2, true);

what is my mistake? i've also tried the following but it doesn't work:

var dropShadowTween:Tween = new Tween(mySprite.filters[0], "distance", Regular.easeOut, 4.0, 20, 2, true);
+2  A: 

the main problem with the tweening of filters is that you have to reassign them before they change, just changing the value of the dropshadow wont make a difference until you call mySprite.filters = new Array(dropshadow) again. Just incase it becomes needed further down the line!

i would personally use TweenLite by Greensock with its FilterPlugins, works a treat!

shortstick
ah... this would be an ideal situation to use a TweenEvent.MOTION_CHANGE event listener. thanks.
TheDarkInI1978
just noticed that attempting to tween multiple filters at the same time can be catastrophic.
TheDarkInI1978
oh, actually it's not catastrophic. i forgot to add the new tweens to the class scope.
TheDarkInI1978