# onMotionFinished help

**URL:** <https://forum.kirupa.com/t/onmotionfinished-help/208049>\
**Category:** flash\
**Created:** [November 24, 2006, 9:53am UTC](https://forum.kirupa.com/t/onmotionfinished-help/208049 "2006-11-24T09:53:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alesys](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@alesys](https://forum.kirupa.com/u/alesys)\
**Post date:** [November 24, 2006, 9:53am UTC](https://forum.kirupa.com/t/onmotionfinished-help/208049/1 "2006-11-24T09:53:57Z")

</div>

I have this function

```auto
function createLoader(i, data, num) {
    thisLoader = eval("container_mc.loader"+i+"_mc");
    thisLoader._alpha = 0;
    thisLoader.loadMovie(data[num].path);
    
    c.capela.text = data[num].cap;
    
    watcher_mc.onEnterFrame = function() {
        var picLoaded = thisLoader.getBytesLoaded();
        var picBytes = thisLoader.getBytesTotal();
        if (isNaN(picBytes) || picBytes<4) {
            return;
        }
        if (picLoaded/picBytes>=1) {
            swapPlace("container_mc.loader2_mc", 1);
            **c.alpha(data[num].fadeTime, 100);**
            thisLoader.alpha(data[num].fadeTime, 100);
            timerInterval = setInterval(imageGen, data[num].timer, data);
            delete this.onEnterFrame;
        }
    };
}

```

I want movie clip c to fadein “data[num].fadeTime” after thisLoader. and Fade Out data[num].fadeTime before thisLoader fade out. theLoader duration is “data[num].timer” so we have all requided vars.

e.g. fade = 2, timer = 8,

image fadein duration fadeout

```
  2 + 8 + 2

```

How can I say to movieclip c wait “data[num].fadeTime” then fade in “data[num].fadeTime” + stay “data[num].timer” minus "data[num].fadeTime \* 2 " and fadeout data[num].fadeTime.

I bold that paret where I try it but this can be out of this function too.

its a bit complicated, but for a AS coder, not so. Im designer not coder.
