# Import Tween Class once or multiple times?

**URL:** <https://forum.kirupa.com/t/import-tween-class-once-or-multiple-times/181192>\
**Category:** flash\
**Created:** [March 7, 2006, 7:30am UTC](https://forum.kirupa.com/t/import-tween-class-once-or-multiple-times/181192 "2006-03-07T07:30:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierce\_Bronkite](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@Pierce\_Bronkite](https://forum.kirupa.com/u/Pierce_Bronkite)\
**Post date:** [March 7, 2006, 7:30am UTC](https://forum.kirupa.com/t/import-tween-class-once-or-multiple-times/181192/1 "2006-03-07T07:30:08Z")

</div>

Hello everyone. I am using the tween class on my first key frame of my mc. It looks like this;

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myTween:Tween = new Tween(main_mc, "_x", mx.transitions.easing.Elastic.easeOut,590, 0, 3, true);

```

However my question is if I have multiple mcs that will use the same code how do i reference it? Currently I have the above code duplicated on two key frames, one of the first and another after a stop keyframe.

I am thinking I should put this in a global function or maybe some other way but not sure how. Any help is appreciated.
