Help with shadow animation
I'm having a bit of a difficulty animating a shadow. I have several pieces of art on the stage with a shadow on them. I have them on a tween, that will enlarge them (one at a Time) from there current state (100%) to (300%). What I'm trying to do is as the art increases in scale the shadow decreases to nothing, and on the return tween will increase the shadow back to the original setting.
I'm able to get the shadow the fade out, but its not smooth, or precise enough (may have something to do with the timimg of the tween itself), then there is the problem of animating the shadow back on the scale down.
here is the code I have that I have been trying to get that effect
//Function called by an enterframe listener so the shadow will change every frame
function drawshadow (e:Event):void
{
makeShadow = new DropShadowFilter();
makeShadow.distance = 5;
makeShadow.angle = 80;
makeShadow.color = 0x333333;
//figured the alpha was the easiest filter to change for the animation I want
makeShadow.alpha = changeshadow
makeShadow.blurX = 2;
makeShadow.blurY = 2;
makeShadow.strength = 1
makeShadow.quality = 15;
makeShadow.inner = false;
makeShadow.knockout = false;
makeShadow.hideObject = false;
//if the stamp is scaling up in the range the alpha decreases (note:the tween to enlarge is .5)
if (stamp.scaleX > 1 && stamp.scaleX<3)
{
changeshadow = changeshadow-.03
stamp.filters = new Array(makeShadow)
}
}
