-
Hi everybody,
yet again I hope for some kind soul to have mercy on me and show me the way... ;)
I've done this site which has a preloader that loads the intro, then starts paying it while the rest of the site downloads... just the usual...
Now I want to add a progressbar to indicate how much has loaded - just to give the visitor an idea.
My problem is that I have no idea how to implement the AS in a way that it will recognise the bytes for the intro only, rather than the whole site.
The AS I have in place at the moment will indicate the whole bytes of the site, then after 20% or so - the intro starts paying - which just looks wrong.... I've tried so many different angles, but not exactly being the script genius ( I WISH) - I just can't figure it out... :( :( :(
Anyway, here's what I've got there at the moment:
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("intro", 250) {
gotoAndPlay("intro", 1);
}
-
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
//
if ((loaded_bytes/total_bytes)==.2) {
gotoAndPlay(intro, 1);
} else {
gotoAndPlay(currentframe - 1);
}
-
Hannibal,
thanks for your quick response !! :)
I tried to put your script in there - but it didn't work... sorry to say.. (
I replaced my AS with yours and also tried to figure out whether I need to change anything to make it work with mine.. but my understanding of AS is just not that great.. even though I do try, believe me!!
Anyway, I'll keep on trying....!!
Thanks!!!!!
;) Prisca
-
If you go to friendsofed.com and download i think chapter 9 of Foundation Action Scripting there is a perfect sample fla. that suites your problem.
-
Oops
Hi
Funny! I just posted a thread almost identical to this (oops, sorry). Anyway just thought I would mention I have the ch9 folder from friends of ed and it didn't really help as it deals with loading multiple swf's.
I'm still stuck.
Jnr
-
quick update....
thanks everybody for trying... unfortunately I'm still not getting anywhere.
With all the help I got from here and other forum sites... I feel as if getting there, then on testing :( :( - my preloader is either looping, counting up to 150 percent.. or just getting stuck in the loop completely, not going any further.....:( :( :( :( :(
Anyway, I'll keep ou posted!
And JNR, if I get it to work, I'll send you an e-mail, ok?
Thanks again ;)
Prisca
-
Prisca
Thanks, if you get it to work I would grateful if you could pass on your wisdom.
I've basically given up and decided to cheat a little, I'm going to give the user the option of either preloading the entire site with a progress bar (as we can already get this to work) or bypassing the loader and loading scenes by using the simple if frames loaded gotoAndPlay method (sticking a pre_load scene before a main content scene - they won't see a progress bar but hey, that's life). It may actually look like I wanted to do this.. ha ha. Anyway you can check it out on my site on May 1st 2pm ("the big reboot"). I've also stuck in a cache detector so that if they've went through all this crap once and it's still in their cache they won't have to suffer it again. If I had more time I would have broken it up into multiple swf's but I'm already way behind.
Cheers
Jnr