# \[tween class\] Creating multiple tweens and assign variable names

**URL:** https://forum.kirupa.com/t/tween-class-creating-multiple-tweens-and-assign-variable-names/271656
**Category:** flash
**Created:** [September 26, 2008, 12:19am UTC](https://forum.kirupa.com/t/tween-class-creating-multiple-tweens-and-assign-variable-names/271656 "2008-09-26T00:19:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hugot](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@hugot](https://forum.kirupa.com/u/hugot)
#### Post date: [September 26, 2008, 12:19am UTC](https://forum.kirupa.com/t/tween-class-creating-multiple-tweens-and-assign-variable-names/271656/1 "2008-09-26T00:19:52Z")

</div>

Hi there:

I’m trying to create various tween for various movies, comething like this:

```auto

import mx.transitions.Tween;
import mx.transitions.easing.*;
 
function fade_anim(mc, max, min, tempo) {
 var bot_alpha:Tween = new Tween(eval(mc), "_alpha", Regular.easeIn, max, min, tempo, true);
 bot_alpha.onMotionFinished = function() {
  fade_anim(mc, min, max, tempo);
 };
}
 
fade_anim("barra3",90,20,1);
fade_anim("barra4",30,80,1);

```

this code works without problem.

My problem is how to call a specific tween to stop it, for example: onrollover stop the tween assigned to “barra3” mc for example

I can’t use bot\_alpha.stop() it doesn’t work. I think it’s because i have multiple “bot\_alpha” tweens, i need something to dynamic create bot\_alpha1; bot\_alpha2; … …

Thanks for the help!
