Ask a Question related to Macromedia Flash, Design and Development.
-
Bjørn J. Torsen #1
preloaders, why do people make 32000 tutorials on how to make them but NONE on how to USE!
I think I seen thousands of tutorials on how to make a preloader, but what
then? Im sitting there with my little load bar and some scripts .. but so
what? The tutorials always ends with: " .. and there you go, thats how you
make a preloader .. "
Well, HOW do I get to USE it? I have three layers and then it just ends with
a STOP. The typical thing with all these fantastic lessons on how to make a
preloader is that they always have this line at the end: .. "by the way,
don't mind the stop at the end in my example, its just because I dont have a
movie .."
Well, I have!! So, HOW do you put it to use??? Here is the latest very
typical example:
[url]http://www.kirupa.com/developer/mx/percentagepreloader.htm[/url]
Close to giving up ..
Bjørn J. Torsen Guest
-
i really wana make flash which prog do i download? andhow do i make it?
hey guys im really sorry bout bothering u all but im 17 and wana start makin flash can somone gimme a hand? which program, how to work the program... -
GNU make & make.pl are dead: long live Perl makepp
Hi, I have so far not seen the advantage of my 100% Perl syntax - at least not until Emacs learns to syntax highlight the specific parts. Since... -
Makefile: set macro once (Solaris make, GNU make)
Hello, I have a question on a problem that is disturbing me for some time now. I want to set a variable in a Makefile by calling a shell... -
Husky #2
Re: preloaders, why do people make 32000 tutorials on how to make them but NONE on how to USE!
On Sat, 04 Dec 2004 05:53:33 GMT, "Bjørn J. Torsen" <bjtos@online.no> wrote:
You take and replace the stop with a goto frame _movie. Just think of the pre>Well, HOW do I get to USE it? I have three layers and then it just ends with
>a STOP. The typical thing with all these fantastic lessons on how to make a
>preloader is that they always have this line at the end: .. "by the way,
>don't mind the stop at the end in my example, its just because I dont have a
>movie .."
>
>Well, I have!! So, HOW do you put it to use??? Here is the latest very
>typical example:
>
>[url]http://www.kirupa.com/developer/mx/percentagepreloader.htm[/url]
loader as it's own movie.
TheWB and an old web site that had hundreds of games had pre loaders that were
actual games. simple games, pick a number, swat the fly, smack this before it
turns blue etc.. Just an animated distraction in a do-while loop while the main
swf loaded.
This one you cite tells you exactly how to use the pre-loader.The above is at the very bottom of the example you gave.> Ex :{ Frame 2 Actions }
> Ex :
> Ex :this.gotoAndPlay(1);
> Ex :
> Ex :Well this is pretty self explanitory, but I will explain anyway. Ok, if all the bytes are not loaded in your movie in frame one, it will automatically move on to frame two, since we can't let it pass frame two yet because the movie isn't loaded we will have to send it back to frame one. This will keep looping around over and over until both the bytes_loaded and the bytes_total variables are equal in numbers. Then the if statement declared at the end of the actions in frame one will send the movie directly to frame three and your movie will start from there.
> Ex :
having a 2 frame pre-loader isn't a necessity. just the actions in the 1st and
last frame of the pre loader.
1st frame start the pre loader
last frame see if conditions {bytes_loaded and the bytes_total} variables are
equal in numbers. If not back to frame one. You're just introducing a machine
delay, by making it repeat frame 1 thru the last frame of the loader until the
entire movie, or a set percentage is met. It may repeat that process several
thousand times depending mostly on speed of your connection. T1 or T2 load
instantly, no repeats. crappy 28.8, 200,000 repeats.
In the above, frame 3 would be where your movie is inserted.
--
more pix @ [url]http://members.toast.net/cbminfo/index.html[/url]
Husky Guest
-
Jeremy #3
Re: preloaders, why do people make 32000 tutorials on how to make them but NONE on how to USE!
I think that is because most people who find those files have already tried
to make one, and the code is confusing; the method is pretty
straightforward. You want your file to wait until it is totally loaded
before it starts playing, or else loop.
//looping script
if( _root.getBytesLoaded() < _root.getBytesTotal() ){
prevFrame();
}else{
play();
}
//loading text
_root.myPercent = int(100*(_root.getBytesLoaded/_root.getBytesTotal) + "%
loaded");
//graphic loading bar
_root.myLoadingBar._xscale =
int(100*(_root.getBytesLoaded/_root.getBytesTotal));
STEP ONE: DO THE LOOP
Frame 1:
play();
Frame 2:
if( _root.getBytesLoaded() < _root.getBytesTotal() ){
prevFrame();
}else{
play();
}
This says: if the number of bytes loaded is less than the total file size,
go back to frame 1. Otherwise, play the movie.
STEP TWO: TELL THE USER WHAT THE HELL IS GOING ON
To display the percent as text, put a right-justifed dynamic text box called
'myPercent' (or whatever, I guess you could call it 'Bob') and put this line
of code in Frame 2:
_root.myPercent = int(100*(_root.getBytesLoaded/_root.getBytesTotal) + "%
loaded");
That will display the percent of movie loaded, as an integer. The text is
right-justified so that when the number changes, the rest of the text
doesn't bounce around like an old Corrola without shocks.
STEP THREE: SHOW THEM GRAPHICALLY, BECAUSE YOU CAN.
(Really not necessary, but at least it's better than those fake preloaders
that loop over and over and don't show what's really happening.)
The easiest way to do this is to draw a bar the same length as the text, and
turn it into a symbol (F8). Name the instance 'myLoadingBar'. Then, in Frame
2, put this code:
_root.myLoadingBar._xscale =
int(100*(_root.getBytesLoaded/_root.getBytesTotal));
Now the bar will grow from 0% to 100% as the movie loads.
ALL DONE!
If you want to see it work, because for some reason you don't have a real
movie (?) make a movie with three frames. Put actions on the first layer,
with the above code in Frames one and two, and in the third frame put:
stop();
On layer two, in the first two frames, put the text box and the loading bar.
These should be present in both frames, so when it loops they are on the
screen. Then, in frame three, under the stop action, hit F7 (make a blank
keyframe) and put a photo.
Now, layer 1 should have three frames with actions (play(), the percent
looping script, and stop()) and layer two should have two frames with the
loading text and bar, and one frame with a photo. When you test the movie,
you can set the simulated load time to imitate a 56kb modem, and it will
chow you the percent loading. Whee!
And seriously, switch to decaf. This is supposed to be fun. The reason the
other preloader tutorials stopped after the first two frames is because
that's all you need; just put it at the beginning of any movie.
Jeremy
"Bjørn J. Torsen" <bjtos@online.no> wrote in message
news:xhcsd.58074$K7.32247@news-server.bigpond.net.au...>I think I seen thousands of tutorials on how to make a preloader, but what
> then? Im sitting there with my little load bar and some scripts .. but so
> what? The tutorials always ends with: " .. and there you go, thats how you
> make a preloader .. "
>
> Well, HOW do I get to USE it? I have three layers and then it just ends
> with
> a STOP. The typical thing with all these fantastic lessons on how to make
> a
> preloader is that they always have this line at the end: .. "by the way,
> don't mind the stop at the end in my example, its just because I dont have
> a
> movie .."
>
> Well, I have!! So, HOW do you put it to use??? Here is the latest very
> typical example:
>
> [url]http://www.kirupa.com/developer/mx/percentagepreloader.htm[/url]
>
>
>
> Close to giving up ..
>
>
>
>
>
Jeremy Guest
-
Bjørn J. Torsen #4
Re: preloaders, why do people make 32000 tutorials on how to make them but NONE on how to USE!
"Jeremy" <dont@bother.com> wrote in message
news:2Etsd.40016$Ch2.18128@bignews5.bellsouth.net. ..
This is supposed to be fun. The reason the> other preloader tutorials stopped after the first two frames is because
> that's all you need; just put it at the beginning of any movie.
>
> Jeremy
Well, it is at this stage the fun ends in my case cause I have tried to
figure out HOW to open the other movies I have with no loaders so that I
could put the preloader I made in the tutorial to use, but it never works!
That's what I meant about no tutorials on HOW to use the preloaders.
When I open a second file (movie) I then have 2 files open next to eachother
in MX2004, both files have 1 scene each. Then I copy every layer from the
movie and paste as first layer in the preloader file, then I try see if it
goes to the first frame in scene to by altering the script, insted of 1 I
write 2.
Example: this.gotoAndPlay(1); I then rewrite to this.gotoAndPlay(2);
I have also tried to copy the three layers from my preloader file and paste
then INFRONT of my movie and alter the last framescript in my loader so that
it goes the first frame in my movie. I do this by labeling the first frame
in my movie, it never works. I have tried a large amount of technices to try
to find this (1) but where it is? The first frame in whatever movie that are
open?? Ive had problems like this before when MX2004 doesnt wanna swallow
any .gotoAndPlay stuff at all!
Frustrating ..
Bjørn J. Torsen Guest



Reply With Quote

