Preloader

Preloading Issue
I have a reasonably large flash movie - about 500k.

There is a preloader that works like this:

Frame1:
percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
if (percent < 100) {
percentOutput = percent + “%”;
setProperty("_root.loadbar", _xscale, percent);
}

Frame 2:
if (percent == 100){
gotoAndPlay(3);
}else{
gotoAndPlay(1);
}

Problem:
When the movie loads it takes about 30 seconds to get to the preloader, and all I see is black. When I finally see it, the movie is 35-40% loaded. (there are no large grafix in the preloader)

Any advice is greatly appreciated.

Thanx

hmm…im too much of a flash nooB to figure this out…but I can tell you that there is a component that will do it just the same :wink:

http://www.kirupa.com/developer/mx/preloader_component.asp

My humble advice is to check the logic and go back to the basics. You are calling many functions without first creating variables with these functions. I might think about first pulling the returns from the functions you are using into variables and testing the math up front. I think you are on the right path though and I wish you luck!:smirk:

Also, are you calling any sound objects (or any objects) from your library using Actionscript and the Linkage Properties???

If you set something to “Export for Actionscript” in the linkage properties of a clip in the library it will also check the “Export to first Frame” checkbox (which cannot be unchecked otherwise it will not work). This will cause the file to load in Frame 0, which is obviously before Frame 1, where even your preloader starts.

Also DJ LIQUID, if you ever post a question about that component on the forum I will rip your head off and bounce it off a wall. Seriously, don’t mind me, I am just releasing steam, but I really can’t stand that component, there is no use for a preloader component because preloaders are easy enough to make without a component, and we get so many people asking questions and having problems with the component that sometimes I want to ask Kirupa to remove the link on his site for it.

Lostinbeta you are 100% correct. I had sounds linked and apparently they load on frame 0 before the preloader.

And for the record, I don’t like the preloader component.

Thanx!

Yeah, it is an unfortunately incident of the linkage property, but there is no way around it because if it doesn’t load before the movie starts, then the clip cannot be called on :frowning:

Unfortunate indeed.

And YAY another preloader component hater… WEEE :beam: