# Problem with scoping onMotionFinished

**URL:** <https://forum.kirupa.com/t/problem-with-scoping-onmotionfinished/238106>\
**Category:** Uncategorized\
**Created:** [September 7, 2007, 8:19am UTC](https://forum.kirupa.com/t/problem-with-scoping-onmotionfinished/238106 "2007-09-07T08:19:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudey2000](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@dudey2000](https://forum.kirupa.com/u/dudey2000)\
**Post date:** [September 7, 2007, 8:19am UTC](https://forum.kirupa.com/t/problem-with-scoping-onmotionfinished/238106/1 "2007-09-07T08:19:00Z")

</div>

I’m having a bit of trouble figuring out why I can’t trigger the function _playUntil_, which is another private function in this class, in this snippet. This is all residing in a class, and I’m wondering if that is what is making things tricky. Any help would be great. I tried tracing out _currentTween.obj_ as well as _currentDestination_, both of which return _undefined_. Any help would be tremendous.

\*private function processListenerInfo( listenerInfo:String ):Void {  
setCurrentDestinationTo( listenerInfo );  
if (( currentDestination != currentLocation ) && (currentDestination)) {  
currentTween = new Tween(chapterSpawnLocation, “\_alpha”, Strong.easeIn, chapterSpawnLocation.\_alpha, 0, .4, true);  
currentTween.onMotionFinished = function() {  
playUntil( currentDestination );  
}  
}  
\*}
