# onMotionFinished() not working anymore?

**URL:** https://forum.kirupa.com/t/onmotionfinished-not-working-anymore/187390
**Category:** flash
**Created:** [April 28, 2006, 6:59pm UTC](https://forum.kirupa.com/t/onmotionfinished-not-working-anymore/187390 "2006-04-28T18:59:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)
#### Post date: [April 28, 2006, 6:59pm UTC](https://forum.kirupa.com/t/onmotionfinished-not-working-anymore/187390/1 "2006-04-28T18:59:50Z")

</div>

Ok, for my site i have a preloader that slides in, then it slides out once it’s finished. I decided to change a couple things, now the same file with some unrelated changes is giving me syntax errors when publishing it. Heres some code:

```auto
import mx.transitions.Tween;
preloader.bar._visible = false;
container._x = container._y=0;
var preloadTween:Tween = new Tween(preloader, "_x", mx.transitions.easing.Regular.easeOut, Stage.width+100, 428.9, .5, true);
preloadTween.FPS = 30;
preloadTween.onMotionFinished = function() {
 my_mc = new MovieClipLoader();
 preload = new Object();
 my_mc.addListener(preload);
 preload.onLoadStart = function(targetMC) {
  container._visible = false;
  preloader.bar._visible = true;
  preloader.border._visible = true;
 };
 preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
  preloader.bar._xscale = (lBytes/tBytes)*100;
 };
 preload.onLoadComplete = function(targetMC) {
  var preloadDoneTween:Tween = new Tween(preloader, "_x", mx.transitions.easing.Regular.easeIn, 428.9, Stage.width*0.1-500, .5, true);
  preloadDoneTween.FPS = 30;
  preloadDoneTween.onMotionFinished = function() {
   container._visible = true;
   preloader.border._visible = false;
   preloader.bar._visible = false;
  };
 };
 trace(container._x);
 my_mc.loadClip("jj.swf", "container");
 container._lockroot = true;
};

```

Im getting this in the output window:

```auto
**Error** Scene=Scene 1, layer=actions, frame=1:Line 6: There is no property with the name 'onMotionFinished'.
     preloadTween.onMotionFinished = function() {
**Error** Scene=Scene 1, layer=actions, frame=1:Line 21: There is no property with the name 'onMotionFinished'.
       preloadDoneTween.onMotionFinished = function() {
Total ActionScript Errors: 2 Reported Errors: 2

```
