# Preloader problems

**URL:** <https://forum.kirupa.com/t/preloader-problems/285486>\
**Category:** Uncategorized\
**Created:** [April 1, 2009, 1:36pm UTC](https://forum.kirupa.com/t/preloader-problems/285486 "2009-04-01T13:36:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashAndy](https://avatars.discourse-cdn.com/v4/letter/f/f07891/32.png) [@FlashAndy](https://forum.kirupa.com/u/FlashAndy)\
**Post date:** [April 1, 2009, 1:36pm UTC](https://forum.kirupa.com/t/preloader-problems/285486/1 "2009-04-01T13:36:00Z")

</div>

Ok so I have a big swf to load so thought I’d make up a preloader to load the file externally then dissappear when the file loaded. The loader works fine and cycles through to 100% and then the external file loads but the preloader doesn’t go away, it just stays sat in the middle of the page. Here is my AS code:

stop();  
this.myBookHolder\_mc.loadMovie(“ecat\_test3.swf”);  
this.myPreloader\_mc.onEnterFrame = function() {  
var l = \_parent.myBookHolder\_mc.getBytesLoaded();  
var t = \_parent.myBookHolder\_mc.getBytesTotal();  
if (l\>=t && t\>0) {  
delete this.onEnterFrame;  
this.\_visible = false;  
} else {setLoaded();}  
};

function setLoaded(){  
var l = this.myBookHolder\_mc.getBytesLoaded();  
var t = this.myBookHolder\_mc.getBytesTotal();  
var percent = Math.round(l/t\*100);

this.myPreloader\_mc.loading\_txt.text = percent+"%";  
this.myPreloader\_mc.circle\_mc.\_rotation += 12;  
}

What is the problem?

Any help appreciated as I’m on a deadline with this.

The 2 lines under the if statement don’t seem to work. With \_visible = false; the preloader doesn’t appear at all.

Help.

I’m using Flash 8, output settings are for FlashPlayer 6, AS2.

Andy
