View Full Version : stupid preloader problem
AroundTheFur 05-22-2003, 04:05 PM ok im starting to make a website and i have the basic interface, and its like 190k, so i want to make a preloader. i copied and pasted some code and altered it to my liking but it does not work at all when i stream it or publish it, it just skips the whole preloader. heres my code:
_root.attachMovie("loader", "loader", 4);
with (loader) {
_x = 340;
_y = 240;
}
stop();
_root.onEnterFrame = function() {
percent = _root.getBytesLoaded()/_root.getBytesTotal()*100;
frame = Math.ceil(percent/4);
_root.loader.gotoAndStop(frame);
if (percent == 100) {
_root.gotoAndStop( 5 );
}
}
i have a movie clip called loader, that has 25 frames, and as the frames progress it reveals more of an image. now i thought maybe because theres an image there and it has a file size that wouldnt work so i tried just a bar and got the same results. this is probably a newbie question but i cant figure it out. if you think you need the file to fix it here it is.
test.fla (http://pratt.edu/~shallqui/test.fla)
|
|
AroundTheFur
05-22-2003, 07:25 PM
when i test run it, it tells me the % of the file loaded but says (0 frames) untill it gets to 100%, so its not loading my first frame, anyone know why?
AroundTheFur
05-22-2003, 07:41 PM
i just realized i had the wrong file posted, not that any of you looked but if you do itll be the right one now!
fraggle two
05-23-2003, 07:19 AM
hi,
i think u can try to place the stop action at the end of your code...
thats not for sure because i'm sitting here at school and cant try it out...
try it yourself
mike
AroundTheFur
05-23-2003, 04:44 PM
nah this problem is very strange. i took out just the loader and put it in a new file, and just dropped an image on frame two, and it worked, then when i moved all the stuff from my old library into the new files, without even putting in script to attach them or anything, it DIDNT work, and i made sure to turn off export for actionscript for those that didnt need it. so basically what im gonna do is just have it load the swf file.
but heres the question, how do i have it load the swf, loadMovie() will just open it up, and the person would just have to wait again, with no loader, defeating the purpose.
Try have alook at the tutorial here:
http://www.nasi-goreng.com/interactive/tutorials/flashmx/loading.html
cheers,
Yulius
Helioz
05-31-2003, 01:30 AM
http://www.neobits.de/tutorials/flash/simple_preloader_1/simple_preloader_1.htm
Another tutorial
Virusescu
05-31-2003, 02:02 AM
the code seems fine to me.. but.
"when i stream it or publish it, it just skips the whole preloader".
Of course it does. It does the same thing to me... After you published... have you tried it online?
Running the site from your hard would do no good because the 170Kb are loaded instantly so GetBytesLoaded reaches instantly GetBytesTotal and skips to the 5th frame.
On the other hand when you stream ... flash streams only the movie that you are working on directly. The movies that you acces with loadmovie commands are loade instantly. If you'd like to view on your computer the effect of the preloader with streaming... you'll have to include it (the preloader) into the same timeline. This dosn't mean that when it will be online it wont work.
Just tryit online
I don't kown if there are some settings for this problem with the streaming though.
Hope it helps ;)
hey
dyou have flashmx?..
if you do , dyou know about the components?
try downloading this component
http://www.romiglia.com/esenciales/index.html
this guy has given us some really cool stuff...
preloaders..
scrollbars..
message forms...
etc..
all in one pack....
i used his preloader here
http://www.sal-im.com
all you have to do is place the movie in the 2nd scene and add the preloader in the 1st..
tweak some settings and youre done.....
and if youre stil having problems like:
1.preloader loads the movie;
2.but shows the end of the animation not the beginning when the movie is loaded.....
in this case make the animation scene a movie clip and add it to the first frame and delete all other frames...
i hope this helps.
CGTalk Moderation
01-15-2006, 05:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.