# Why does this preloader not work?

**URL:** <https://forum.kirupa.com/t/why-does-this-preloader-not-work/246370>\
**Category:** Uncategorized\
**Created:** [December 10, 2007, 3:57pm UTC](https://forum.kirupa.com/t/why-does-this-preloader-not-work/246370 "2007-12-10T15:57:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpixel](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jpixel](https://forum.kirupa.com/u/jpixel)\
**Post date:** [December 10, 2007, 3:57pm UTC](https://forum.kirupa.com/t/why-does-this-preloader-not-work/246370/1 "2007-12-10T15:57:31Z")

</div>

\_root.stop();

this.onEnterFrame = function() {

```
bar_mc._width = int(_root.getBytesLoaded()/_root.getBytesTotal()*100)*2;
percent_txt.text = int(_root.getBytesLoaded()/_root.getBytesTotal()*100);

percent_txt._x = int(bar_mc._width);

if (_root.getBytesLoaded() == _root.getBytesTotal()) {

    doClose();

    
}

```

};

function doClose(){

```
    bar_mc.scaleTo(1,1,"easeOutElastic");
    
        bar_mc.onTweenComplete = function() {
        //bar_mc.gotoAndPlay(2);
    
    _root.nextFrame();
    };

```

}

I want it to execute the doClose function…it doesn’t, however if I add the code without onTweenComplete it works fine…any ideas?
