# Using the tween class within a class and .onMotionFinished

**URL:** https://forum.kirupa.com/t/using-the-tween-class-within-a-class-and-onmotionfinished/291560
**Category:** Uncategorized
**Created:** [July 1, 2009, 1:11pm UTC](https://forum.kirupa.com/t/using-the-tween-class-within-a-class-and-onmotionfinished/291560 "2009-07-01T13:11:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)
#### Post date: [July 1, 2009, 1:11pm UTC](https://forum.kirupa.com/t/using-the-tween-class-within-a-class-and-onmotionfinished/291560/1 "2009-07-01T13:11:36Z")

</div>

trying to get the .onMotionFinished method of my tween instance within my class to have access to class variables and methods:

```auto
var t1:Tween = new Tween(myClip, "_alpha", None.easeNone, 0, 100, 1, true);
t1.onMotionFinished=function()
{
trace("this is a var from the class: "+classVar);
}

```

right now the ‘classVar’ variable from the class comes back as undefined. the tween is outside of the class scope correct? How can i make the tween instance have access to the class scope so i can call a method from the class and access class variables?
