Preloader

I need help to figure out a problem with preloader. I amde one with the

if frameLoaded (“end”) {
gotoAndPaly(“start”);
}

But when I publish it and try to view it on the web, the browser is loading forever and then flash comes then preloader works like say 1 sec then it is working.

Is there any way I can make the browser to open flash immidiatly then the preloader would load the movie???

The movie is 2mb.

Any one help!!!
:frowning:

read this thread:

http://www.kirupa.com/developer/mx/preloader.htm

/sput

Didn’t work. The browser download again before showingthe preloader… once the movie loads in, it is already load to 70 - 80 % after that, everything works fine. I tought about javascript preloader but flash is not a image. SO it won’t work. Any other ideas?:trout:

:bounce: Well, I’ll assume that your preloader is in the same .swf file that you’re loading. So, quite frankly, you’re probably experiencing the “export in first frame” sydrome (we’ll call it that because every last flash newbie – me included – suffers from it). In order to load anything for action scripting, you’ve gotta use linkage (open your library (F11), right click on any clip in your library and, near the bottom, you’ll see a selection known as “Linkage…”). Now that you’re in the linkage dialog box, you’ll see four selections (the first of which is “Export for ActionScript”, which, if I’m not mistaken, needs to have “export in first frame” in order to work). If one of the selection checked is “export in first frame”, that’s why your preloader doesn’t work (not because you have it in the first frame, or because you don’t have the preloader “Exported for ActionScript”, but because things are being loaded before it). Now, don’t misunderstand, do not select “Export for ActionScript” for your preloader (unless you understand what you are doing and you’ll be doing other things with it besides just having it display text or extend a load bar).

So, you may be saying to yourself now…“Okay, great. Now how do I fix this annoying problem, and how do I get a frame to load before the first frame?” You have a separate .swf which loads your main swf. You’ll more than likely be using a variation of “loadMovie” for this.


//we made the preloader 
//symbol have actionscript here
onClipEvent (load) { 
//we're loading "main.swf" into level 1
loadMovieNum ("main.swf", 1); 
//this is my load bar symbol that 
//has an instance name of loadBar
loadBar._xscale = 0; 
} 
onClipEvent (enterFrame) { 
//we're getting bytes here 
//not frames; sorry, I don't like 
//frame loading anyway
//total bytes
var total = _level1.getBytesTotal(); 
//loaded bytes
var loaded = _level1.getBytesLoaded(); 
//calculate percentage
percent = (loaded/total)*100; 
//extend loadBar via x scale 
//and the loadBar is oriented to 
//the left, so it extends to the right

loadBar._xscale = percent; 
//let's get a nice even number
// instead of the actual percent now...
percentDisplay=Math.round(percent)+"%";
//if the loaded variable equals the
// total variable, then lets show level 1
// (_level1) which has had the movie loading
// into it
if (loaded == total) { 
_level1._visible=true;
_visible=false;
} else { 
//if the loaded variable doesn't 
//equal the total variable, then lets
// keep level 1 hidden for the time being
_level1._visible=false;
_visible=true;
} 
} 

Any way, I hope that helped and made sense to you.

Good luck,
–Elios

P.S. The attached file isn’t mine and I didn’t write the AS. I did comment, so, if I screwed up, tell me.

Thanks a lot! The stupid linkage… I understand!! Thanks 2000x.

I’ll let you know if it is working.:tie:

The preloader works except the audio isn’t working. I didn’t change anything to the adio linkage setup. I tried to unselect the export to first thing but it kills the audio. Anyway, anything I could do in the loader to make the music playing? Thanks again… learning everyday!!!