PDA

View Full Version : Preloader question



fusion37
January 11th, 2004, 07:11 PM
My first post here and any info or help would be much appreciated...:D

I've read all the preloader tutorials, and I've spent about 2 days smacking my head against the wall on this and I think I cannot see the forest through the trees at this point.
I have an original flash site that has a preloader mc and it functions 100%.

//code for the original site preloader that functions

bytesLoaded = (_level0.getBytesLoaded());
bytesTotal = (_level0.getBytesTotal());
percentSetup = ((bytesLoaded/bytesTotal)*100);
percentage = int(percentSetup) add "%";
if (bytesLoaded == bytesTotal) {
_root.gotoAndPlay(3);
}


I take this preloader and dump it into a new site and it doesn't work...:-/

Now this new site is actually much larger than the original site and the swf for it is close to 2 MB.

Is there a size constraint that makes using preloaders inefficient?

I've tried making the preloader in another scene and still no go, maybe I should try the preloader and load the site with AS for loading an external swf? I've read a few post from the forum and I'm not sure I understand 'how' to get the preloader to match the % bytes of the externally loading swf...

Any suggestions?

thx

upuaut
January 12th, 2004, 12:49 AM
Size does make a difference. ;)

you could try this to see if it helps.



bytesLoaded = _level0.getBytesLoaded();
bytesTotal = _level0.getBytesTotal();
percentSetup = (bytesLoaded/bytesTotal)*100;
percentage = int(percentSetup) add "%";
if (bytesLoaded == bytesTotal & bytesTotal!=0) {
_root.gotoAndPlay(3);
}


When a movie first loads, especially a large movie, the player may read totalBytes of the movie as 0. The addition to the if statement may help this.

(PS I took out some usless parentheses in there. Doubling up on them the way you did just adds file size, not organization, so I figured I'd remove em. :) )

fusion37
January 12th, 2004, 08:04 PM
I'll give it a try...
I don't have access to try anything right now, but I'll post back later
thx upuaut