# Tweening question

**URL:** https://forum.kirupa.com/t/tweening-question/196004
**Category:** Uncategorized
**Created:** [August 4, 2006, 2:48pm UTC](https://forum.kirupa.com/t/tweening-question/196004 "2006-08-04T14:48:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![firestream](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/firestream/32/2662_2.png) [@firestream](https://forum.kirupa.com/u/firestream)
#### Post date: [August 4, 2006, 2:48pm UTC](https://forum.kirupa.com/t/tweening-question/196004/1 "2006-08-04T14:48:27Z")

</div>

I’ve got a couple instances of the same movie clip on the stage. Via actionscript, I want to apply a tween to both instances. Then, when you click on the instance I want its tween to stop, but not affect the other instance. Does that make sense?

So here’s my code so far:

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;
 
function startHeartbeat(obj) {
 var myTween1:Tween = new Tween(obj, "_xscale", Regular.easeInOut, 100, 150, 1, true);
 var myTween2:Tween = new Tween(obj, "_yscale", Regular.easeInOut, 100, 150, 1, true);
 
 // after the animation is done, keep doing it
 myTween1.onMotionFinished = function() {
  myTween1.yoyo();
  myTween2.yoyo();
 }; 
}
 
function stopHeartbeat(obj) {
 // set the movie clip back to its original scale
 obj._xscale = 100;
 obj._yscale = 100;
 
 // now what???
}
 
startHeartbeat(ball_mc);
startHeartbeat(ball_mc2);
 
ball_mc.onRelease = function () {
 stopHeartbeat(ball_mc);
};
ball_mc2.onRelease = function () {
 stopHeartbeat(ball_mc2);
};

```

Any help here is greatly appreciated!
