# I've Posted Some Code (Preloader) -- Please Double-Check!

**URL:** <https://forum.kirupa.com/t/ive-posted-some-code-preloader-please-double-check/218737>\
**Category:** flash\
**Created:** [March 10, 2007, 7:09am UTC](https://forum.kirupa.com/t/ive-posted-some-code-preloader-please-double-check/218737 "2007-03-10T07:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![decisionman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/decisionman/32/1673_2.png) [@decisionman](https://forum.kirupa.com/u/decisionman)\
**Post date:** [March 10, 2007, 7:09am UTC](https://forum.kirupa.com/t/ive-posted-some-code-preloader-please-double-check/218737/1 "2007-03-10T07:09:21Z")

</div>

Hello All,

So … this site again: [www.theproblemofnothing.com](http://www.theproblemofnothing.com). Oh man. Sometimes it freezes, sometimes it doesn’t. Sometimes it works on IE and not Firefox, sometimes on Firefox and IE. I _think_ I’ve got it fixed. But I can’t rest. I’m not sure. The main movie calls externals SWFs via loadMovie - here’s the code from one of the many individual movies:

```auto
#include "lmc_tween.as"
this.stop();

```

That’s on the first frame. Here’s the second:

```auto
this.stop();

//--------------------------------
// THE SET UP
//--------------------------------

artwork_mc._alpha = 0;

//--------------------------------
// GO TIME!
//--------------------------------

goAhead = function () {
    artwork_mc.tween("_alpha", 100, 1, "easeInOutCubic", 0);
}
goAhead();    

```

Here’s the first frame within the preloader bar:

```auto
bar._width = 0;

```

And the second frame of the preloader bar:

```auto
this.onEnterFrame = function() {
    var bt = _parent.getBytesTotal();
    var bl = _parent.getBytesLoaded();
    var percent = bl/bt;
    bar._width = Math.round(percent*91);
    if (bt == bl) {
        delete this.onEnterFrame;
        this.tween("_alpha", 0, 0.5, "easeInOutCubic", 0, themainer);
    }
};
function themainer() {
    _parent.gotoAndStop("main");
}
//themainer();
stop();

```

That’s about it. The buttons in the \*main \*file are just:

```auto
icon_mc_1.onRelease = function(){
    container_mc.loadMovie("_art/image_1.swf");
    this.tween("_y", 533, 1.5, "easeOutElastic", 0);

```

OK. That’s it. Promise. I _think_ I fixed it by adding the “.this” parameter to some of script in the loader – I believe the “stop();” was stopping the main movie itself. Hmm. But I’m not sure.

Well, if you’ve got some free time, please check my code, let me know what you think! \<3’s for Kirupa. Saved my \*\*\* so many times.

Cheers,  
Mark(decisionman)
