PDA

View Full Version : Preloader (not quite) working....


spike101
06-20-2005, 09:16 PM
I decided (after I made an animation) to stick in a preloader for it.

However, when I test the movie it just says loading but the script to get the percentage to increase doesn't run.

I've been hunting through it for ages and I can't find anything.

spike101
06-21-2005, 03:59 PM
okay, I put in a trace command to find a little bit more about what was going on and it just returns '0' every time. It's going in an endless loop and the number won't increase.

Here's the code I'm using and it's worked on other fla's....what's the problem?


onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percent -= (percent-((loading/total)*100))*.25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;
trace(per);
if (percent>99) {
_parent.gotoAndStop(2);
}
}

Flash Gordon
06-21-2005, 04:15 PM
http://actionscripts.org/forums/showthread.php3?t=74988&highlight=Preloader+tutorial

spike101
06-21-2005, 04:31 PM
but I have this working in another MX 2004 fla file....why would it stop in THIS one?

oldnewbie
06-21-2005, 05:06 PM
That code most probably comes from this (BAD BAD script to start with...) "smooth preloader" tutorial... (http://www.actionscripts.org/tutorials/beginner/Smooth_PreLoader/index.shtml)
on which a note on the top of the page, cleary warns that it doesn't work in MX2004.

I, for one, hope it never does!

spike101
06-21-2005, 05:33 PM
okay, I finally figured out what the problem was.

For some reason (and I don't know how), my publish settings on the file that worked with that older preloader were set to Flash5. I used the new preloader in the link you gave me and discovered this when it told me that Flash5 didn't support that one!

I don't know how that got changed, but there you have it.

thanks for the help.