This content has been marked as final.
Show 16 replies
-
1. Re: kglad's preloader
kglad Aug 17, 2006 7:01 AM (in response to Star_Tail_Pro)instead of _root, use _level2 to display the load progress of mainpreloader.swf.
p.s. your repeat definition of lBy is unneeded. -
2. Re: kglad's preloader
blemmo Aug 17, 2006 7:02 AM (in response to Star_Tail_Pro)The main movie runs in level 0, so you can access it from anywhere with _level0.
But shouldn't the preloader load the main movie? I'm not sure how Flash handles this, but I think in your current setup, the main movie will load while the preloader is also loading, so you will never get a start at 0%, because the preloader is part of the main movie. Maybe it would be better to have the preloader movie extra and load the main movie into this.
hth,
blemmo -
3. Re: kglad's preloader
Star_Tail_Pro Aug 17, 2006 7:05 AM (in response to kglad)so is it mainpreloader.swf:
var num = setInterval(this, "preload", 10);
_level2.prebar_mc.stop();
function preload() {
var tBy = _root.getBytesTotal();
var lBy = _root.getBytesLoaded();
trace("tBy: "+tBy);
trace("lBy: "+lBy);
var div = lBy/tBy;
trace("div: "+div);
var per = Math.round(div*100);
_level2.prebar_mc.gotoAndStop(per);
trace("per: "+per);
_level2.per_txt.text = per+"%";
if(tBy == lBy) {
_level2..per_txt.text = "100%";
clearInterval(num);
_level2.prebar_mc.stop();
}
} -
4. Re: kglad's preloader
Star_Tail_Pro Aug 17, 2006 7:15 AM (in response to Star_Tail_Pro)reply to blemmo:
once the preloader loads into the main movie the preloader will then monitor the load of the mian movie so it will start at 0% -
5. Re: kglad's preloader
kglad Aug 17, 2006 7:20 AM (in response to Star_Tail_Pro)star, do you have stand alone preloader (mainpreloader.swf) that's loading your main swf (into some _level) and the code you showed in another swf? ie, you have 3 swfs?
if so, what is it that you want to display? the load progress of the preloader followed by the load progress of you main swf?
and why is your mainpreloader.swf so large that it needs a preloader? you're doing something wrong when that happens. if you have a beautiful fancy animation that you want to display, it should probably be removed from your preloader and made into an intro to your main swf. -
6. Re: kglad's preloader
Star_Tail_Pro Aug 17, 2006 7:28 AM (in response to Star_Tail_Pro)preloader is loading the main swf and i do have an animation but its not fancy (just my logo jumping up and down) in it but taking kind defeats the purpose. I have seen a lot of preloaders that have animation and i want to make the samething. Also they all start at 0% and i am trying to figure out how they do it. -
7. Re: kglad's preloader
kglad Aug 17, 2006 7:33 AM (in response to Star_Tail_Pro)so, how large is your preloader? -
-
9. Re: kglad's preloader
kglad Aug 17, 2006 7:44 AM (in response to Star_Tail_Pro)is that the size of mainpreloader.swf? if so, it doesn't need a preloader. -
10. Re: kglad's preloader
Star_Tail_Pro Aug 17, 2006 7:48 AM (in response to Star_Tail_Pro)main swf is called message.swf to make it easier and it is a 1MB and the mainpreloder.swf is the file that has the preloader in it which is 5KB. -
11. Re: kglad's preloader
kglad Aug 17, 2006 6:17 PM (in response to Star_Tail_Pro)then the following code should appear in mainpreloader.swf and should be attached to a frame that plays EXACTLY once. your preload bar and your textfield should be in mainpreloader.swf. there should be nothing (related to the preloader) in message.swf
your browser will open mainpreloader.swf and it will begin loading message.swf and it will display the load-progress of message.swf. when loading is complete the preloader will no longer be visible.
if you want something to happen in message.swf when loading is complete (like have it play), then near the this._visible=0 line add your code (like _level2.play() ). -
12. Re: kglad's preloader
Star_Tail_Pro Aug 18, 2006 4:04 AM (in response to Star_Tail_Pro)oh see i didn't get that reading from other forums where you suggested the same thing. Thank You -
13. Re: kglad's preloader
Star_Tail_Pro Aug 18, 2006 4:15 AM (in response to Star_Tail_Pro)Although now realising the message.swf acts oldly. The actionscript code is alright its the amfphp side that acts oddly. But nothing to worry about. -
14. Re: kglad's preloader
kglad Aug 18, 2006 10:54 AM (in response to Star_Tail_Pro)you're welcome. good luck with the amfphp issue(s). -
15. Re: kglad's preloader
Star_Tail_Pro Aug 18, 2006 3:35 PM (in response to Star_Tail_Pro)so far i am having no luck. I going to do take away all the code and add it in bit by bit method now. Yeach :( -
16. Re: kglad's preloader
Harry Kunz Jan 25, 2010 9:15 PM (in response to Star_Tail_Pro)I too have experienced this problem before that the loading does not start at zero percent. The reason for that is that before your SWF even reaches frame 1, the flash player is loading part of the content ahead of time. The best way to solve this is to separate the preloader SWF from the content SWF and make the preloader file size as small as possible so that it will popup immediately. I have made a preloader that dynamically gets drawn. I was able to make it only 1.35 KB in size. See a sample output of some flash contents preloaded in different articles at my blog http://flashuniversity.blogspot.com/. I have also attached here a copy you can use, just change the SWF file name in frame 1 which is currently set as "External.swf"
-
SwfLoader.fla.zip 6.2 K
-