# Calling function from within onMotionChanged not working!

**URL:** <https://forum.kirupa.com/t/calling-function-from-within-onmotionchanged-not-working/220122>\
**Category:** flash\
**Created:** [March 22, 2007, 9:55pm UTC](https://forum.kirupa.com/t/calling-function-from-within-onmotionchanged-not-working/220122 "2007-03-22T21:55:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elihorn](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elihorn/32/2458_2.png) [@elihorn](https://forum.kirupa.com/u/elihorn)\
**Post date:** [March 22, 2007, 9:55pm UTC](https://forum.kirupa.com/t/calling-function-from-within-onmotionchanged-not-working/220122/1 "2007-03-22T21:55:26Z")

</div>

Hi there! Hopefully someone can help me with this . . . it seems simple enough.

I have a movieclip that tweens when you roll over or out it, which in turn is supposed to call a function from another class which adjusts clips according to the first clip’s position.

For some reason I can’t get any function to call from inside the onMotionChanged function? It will trace fine, but will not execute any function (regardless of where it is declared). What am I doing wrong?

Here’s the roll out function:

```auto
private function menuRollOut() {
		var thisObj = this;
		var thisObj = thisObj._parent;
		if (!thisObj.hitTest(_xmouse, _ymouse)) {
			var menu_tween:Object = new Tween(thisObj, "_x", Regular.easeOut, thisObj._x, 0-thisObj._width+15, 0.5, true);
			menu_tween.onMotionChanged = function() {
				trace("tweening");
				tweenFunc();
			};
		}
	}

```
