PDA

View Full Version : Preload for "tornado" ?


Leon
10-03-2002, 05:33 PM
Hello,

http://www.levitated.net/daily/indexPredilection.html

I tried to put a preload for the "Tornado Code Poetry"... it did not work : the preload just appeared before the animation was displayed ( around 90 % ). The preload does work if it charges a heavy image for example.

Any solution ?

Thanks,

Leon

barret
10-03-2002, 07:26 PM
is your preloader going by bytes or frames?

Leon
10-03-2002, 07:38 PM
This is the one I used :

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 ("Scene 1", 1) {
gotoAndPlay ("Scene 1", 1);
}


http://www.actionscripts.org/tutorials/intermediate/flash5_preloaders/index2.shtml

Should I put another type of preload ?

Thanks for your help,

Leon

barret
10-04-2002, 10:30 PM
Well, If it goes by bytes its probably the order in which the movie has decided to load the bytes that makes it skip from 90% to finished, but I think that if you want to stop skipping and keep on going without having to add anything to it, I'd reccomend getting one that goes by frames. This type is much simpler, heres where you can find a tutorial : http://www.flashkit.com/tutorials/Actionscripting/If_Frame-Eddie_Ca-120/index.php.
I hope this helps. :)

Cremulator
10-05-2002, 10:18 AM
if you are using
ifFrameLoaded ("Scene 1", 1) {
gotoAndPlay ("Scene 1", 1);
then it will gotoAndPlay scene 1 frame 1 as soon as scene 1 frame 1 has loaded ;)

see in the tutorial it specifys if frame 30 has loaded play frame 1...

you could try changing your code to:
ifFrameLoaded (2) {
gotoAndPlay (1);
...but because there are only 2 frames in that tornado code, I would suggest preloading the data.

use something like this (not sure if this is correct but it will be something like this):
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);
if (loaded_bytes == total_bytes ) {
gotoAndPlay (1);
}

Leon
10-09-2002, 01:24 PM
Hello,

Thanks for your help.

The problem remains. I tried both bytes loaded and frames loaded
preloads. The preload is only displayed just before the main animation.

Any solution ?

Thanks,

Leon