# Tween help!

**URL:** <https://forum.kirupa.com/t/tween-help/229086>\
**Category:** flash\
**Created:** [June 13, 2007, 11:56pm UTC](https://forum.kirupa.com/t/tween-help/229086 "2007-06-13T23:56:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theonlycarmire](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@theonlycarmire](https://forum.kirupa.com/u/theonlycarmire)\
**Post date:** [June 13, 2007, 11:56pm UTC](https://forum.kirupa.com/t/tween-help/229086/1 "2007-06-13T23:56:43Z")

</div>

I wrote down the very first word for this thread and realized that I was forgetting one simple fact, so I will account this story for you anyway in hopes that someone will not make this mistake again.

In AS 2.0, you were allowed to invoke a Tween’s onMotionFinished event as a function, thus something as follows:

```auto

var myTween = new Tween(myObj, "alpha", Strong.easeOut, 100, 0, 10, false);
myTween.onMotionFinished=function(){
trace("the tween has been done, master");
}

```

My question was along the lines of how do I invoke this while I’m using AS 3.0? I kept using this:

```auto

myTween.motionFinish=function(){
}

```

and for obvious reasons coming to a failing argument. Thus I remembered that you can’t call events like this anymore!

So the fix is something as follows:

```auto

var myTween = new Tween(myObj, "alpha", Strong.easeOut, 100, 0, 10, false);
myTween.addEventListener("motionFinish", finishFunc);

```

Which would call this function:

```auto

function finishFunc(e:Event){
trace(e.target.obj.alpha);
}

```

The e.target.obj, of course, in reference to the myObj that we put in as our obj in the original Tween.

Anyway, that’s there for anyone who was curious 🙂
