# Custom Preloader Help. Probably an easy fix

**URL:** <https://forum.kirupa.com/t/custom-preloader-help-probably-an-easy-fix/323775>\
**Category:** Uncategorized\
**Created:** [July 17, 2011, 7:59pm UTC](https://forum.kirupa.com/t/custom-preloader-help-probably-an-easy-fix/323775 "2011-07-17T19:59:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hrl2k](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@Hrl2k](https://forum.kirupa.com/u/Hrl2k)\
**Post date:** [July 17, 2011, 7:59pm UTC](https://forum.kirupa.com/t/custom-preloader-help-probably-an-easy-fix/323775/1 "2011-07-17T19:59:37Z")

</div>

- I posted this on another forum but no help so far. Kirupa has always been the most responsive in the past so I should have tried here first! \*

Hey all, It’s been a while since I’ve posted and/or used Flash, and it seems I’m a bit rusty because I can’t get my preloader to work. I’ve searched google for tips and other methods on the way I am doing it, and I really have spent a lot of time trying all kinds of different ways/code, but I can’t get it to work correctly.

I will post my .FLA so you can see what I am doing. I’d like the preloader graphic to unmask itself from left to right (obviously), but I’m not even sure if the code for the mask-movieclip is correct.

Here is my code (no errors on the compiler):

```auto
stop();
mask_mc._width = 1;
this.onEnterFrame = function():Void{
    var lBytes = _root.getBytesLoaded();
    var tBytes = _root.getBytesTotal();
    var percent = Math.floor((lBytes/tBytes)*100);
    mask_mc._xscale = percent;
    text_txt.text = percent + " %"
    if(lBytes >= tBytes){
        gotoAndPlay(2);
    }

```

I _think_ the mask\_mc code is correct? I’d like it to start at 1 width and expand to 100 as the progress happens.

One problem I have is that when I try to “Simulate Download” on slower speeds to test it out, my screen just goes white and nothing happens. Yet I can still ‘Test Movie/Scene’ fine.

If anyone could take a look at my file and give me some hints, I would really appreciate it! thanks,

[http://www.lindesigns.us/flashloadertest.fla](http://www.lindesigns.us/flashloadertest.fla)

-Hrl2k
