# Filter Tweening in action script

**URL:** <https://forum.kirupa.com/t/filter-tweening-in-action-script/216381>\
**Category:** flash\
**Created:** [February 15, 2007, 11:53pm UTC](https://forum.kirupa.com/t/filter-tweening-in-action-script/216381 "2007-02-15T23:53:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RickDC2](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@RickDC2](https://forum.kirupa.com/u/RickDC2)\
**Post date:** [February 15, 2007, 11:53pm UTC](https://forum.kirupa.com/t/filter-tweening-in-action-script/216381/1 "2007-02-15T23:53:26Z")

</div>

Hey guys.

I have a function I use when ever i want to move some thing in flash. it looks like this:

```auto
 
function MoveYourMc(target, newx, newy, speed) 
{ 
    var _loc1 = target; 
    var _loc4 = newx; 
    var _loc5 = newy; 
    var _loc3 = speed; 
    var _loc2 = mx.transitions.easing.Back.easeInOut; 
    myTweenY = new mx.transitions.Tween(_loc1, "_y", _loc2, _loc1._y, _loc5, _loc3); 
    myTweenX = new mx.transitions.Tween(_loc1, "_x", _loc2, _loc1._x, _loc4, _loc3); 
} // End of the function 

```

and i can then call this any where in my movie using:

```auto
 
InstanceName.onRollOver = function () 
{ 
    MoveYourMc(InstanceName, 123, 456, 20); 
}; 

```

which would move “InstanceName” to an \_x of 123 and a \_y of 456 at a speed of 20.

What i have been trying to do is make a similar function for the Glow Filter and im really struggling.

Im wondering if what i need to do is attach the glow filter to the instance before i try and tween it? any one got any ideas?

This is what i have been working with:

```auto
function GlowYourMc(target, newblurx, newblury, speed) 
{ 
    var _loc1 = target; 
    var _loc4 = newblurx; 
    var _loc5 = newblury; 
    var _loc3 = speed; 
    var _loc2 = mx.transitions.easing.Back.easeInOut; 
    target.GlowFilter(0xFFFFFF, 0, 0, 0, 2, 3, false, false);
    myTweenY = new mx.transitions.Tween(_loc1, "blurY", _loc2, _loc1.blurY, _loc5, _loc3); 
    myTweenX = new mx.transitions.Tween(_loc1, "blurX", _loc2, _loc1.blurX, _loc4, _loc3); 
} // End of the function

```

which i have been trying to execute with:

```auto
instanceName.onRollOver = function () 
{ 
GlowYourMc(instanceName, 50, 50, 20) 
};

```
