# Tween + onMotionFinished

**URL:** https://forum.kirupa.com/t/tween-onmotionfinished/164897
**Category:** flash
**Created:** [October 5, 2005, 9:06pm UTC](https://forum.kirupa.com/t/tween-onmotionfinished/164897 "2005-10-05T21:06:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DigitalMac](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@DigitalMac](https://forum.kirupa.com/u/DigitalMac)
#### Post date: [October 5, 2005, 9:06pm UTC](https://forum.kirupa.com/t/tween-onmotionfinished/164897/1 "2005-10-05T21:06:35Z")

</div>

I’ve got the following code in my actionscript class. When the onMotionFinished is run, it is not referencing my class to execute the slide() method. How would I properly do this?

```auto
		
var tween = new mx.transitions.Tween(target, "_y", easeType, beginPos, endPos, slideSpeed);
tween.onMotionFinished = function() {
	this.slide();
}

```

Of course I can always go through the instance of my class like the following example, but that is not good practice.

```auto

_root.myInstance.slide();

```
