# Stop A running Tween on rollOver

**URL:** <https://forum.kirupa.com/t/stop-a-running-tween-on-rollover/310509>\
**Category:** flash\
**Created:** [June 11, 2010, 10:58pm UTC](https://forum.kirupa.com/t/stop-a-running-tween-on-rollover/310509 "2010-06-11T22:58:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxth](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@maxth](https://forum.kirupa.com/u/maxth)\
**Post date:** [June 11, 2010, 10:58pm UTC](https://forum.kirupa.com/t/stop-a-running-tween-on-rollover/310509/1 "2010-06-11T22:58:21Z")

</div>

Hi, I would like to know how to stop a running tween when rollingOver a sprite. I used to stop the tween on as2, but I don’t know how to acces the running tween on as3 because of the var statement before the tween name.

I guess the score is modifying the 2 lines:

over\_handler1.stop();  
over\_handler2.stop();

My code is this one:

```auto

function fc_hitOver(e:MouseEvent):void {
    var lastActive:String=e.target.name;
    var numberID:String=lastActive.substr(-1,1);
    var tweenTarget:String="mc_over"+numberID;
    this[tweenTarget].alpha=1;

    
    over_handler1.stop();
    over_handler2.stop();
    
    var over_handler1:Tween=new Tween(this[tweenTarget],"scaleX",Elastic.easeOut,0,1,1.5,true);
    var over_handler2:Tween=new Tween(this[tweenTarget],"scaleY",Elastic.easeOut,0,1,1.5,true);
    }

```

Thanks!!
