-
Hi foochuck,
I have put an example together for you it is base around
the other examples but includes the script we were talking
about.
There are a few typo's corrected (my errors) now it is
running on my web space. If you were going to use this script
some extra flag variables should be added. I can help you with
that. The zip files only contain the .fla file for MainMovie
... to keep the size down. The other Movies just have a
Frame 1 with only a stop(); action and the other content
comes after Frame 1.
Anyway ... you can view it at:
http://www.trump.net.au/~Milosav/example5
and download the zip file at:
http://www.trump.net.au/~Milosav/exa..._part_Five.zip
Any ? Post Back
Milosav
-
milosav
hey, don't mean to bug, but did you get a chance to look over the code yet?
-
Hi tgf,
Yes I had a look at the files. I put togeter a slightly different
preloader code that includes a preloader bar.
It works for me.
Windows 98 Second Edition
Internet Explorer v6
and a connection from the "wilderness" at 14400bps
It is uploaded to my site:
you can view it at:
http://www.trump.net.au/~Milosav/tgfx
and you can get the .zip file at:
http://www.trump.net.au/~Milosav/tgfx/neonA.zip
Have a GOOD look through them.
Your preloader bar is now a seperate .swf file that is
loaded into _level4 then called when needed. At the moment
the progress bar is just a rectangle but it could be almost
anything you wanted.
All the script for the sequential preloading including
the bytes checks are in one centralized place.
About the same place they were before. But the function and
loop have been broken up over Frame 51,52,53,54 of nc-loader.
This has striped it down to almost the bare essentials and
it is easier to see what is going on.
If you think it is heading in the right direction we can
tighten the code then roll it back up into a function.
But it is easier to work on like this ... at the moment.
The .swf files are loaded up the pipeline one at a time
when one is fully loaded the next one is sent up. Each has
a full progress bar. There are a lot of reasons for doing
it this way ... if you want to know what they are just ask.
Post back let me know if it all works for you.
Milosav
-
hey milosav, thanks for responding. I couldn't extract the files from the zip though, it says it's corrupted. I did look at your example that you uploaded, and it doesn't hang, so that's great. I can't wait to check out the fla.
-
Hi tgfx,
Well you were right file was dead.
I have uploaded a new .zip file.
Strange thing though the nc-loader.fla file seems to
have grown in size. The final published .swf is around the
same file size as always. But the original .fla is around 1MB !!!
So the .zip file is around 1/2 MB. Very strange.
The B - I - G .zip is at.
http://www.trump.net.au/~Milosav/tgfx/neonA.zip
Anyway any more problems or questions post back.
Let me know if it is headed in the right direction.
Milosav
-
hey milosav,
that's weird about the file size. there is absolutely no reason for it to be THAT big. anyway I looked at what you've done and it makes a lot more sense, plus it works!!
the only thing that I'd like to change is to have the loading bar work with the loadcount numbers at the bottom. so the bar fills up and then the number progresses to "2", etc. I don't think that would be hard to do though.
one question, would it be possible to check the containers to see if they're loaded, before loading them? the only thing I don't like about this is that it loads them every time the frames are accessed.
-
Milosav,
Once again that info helps/makes alot of sense. Looking forward to your preloader post...
Thanks
-
Milosav,
Sorry for the last post..I didn't see the NEW page of posts and I did get your preloader part 5 file. One question about the script...why do I need this line:
//scale your loader bar
_level4.theBar._xscale=(mcholder1.getBytesLoaded()/mcholder1.getBytesTotal())*100;
}
I'm not sure what it does...I believe it makes the bar.swf file bigger as the movie loads...I might replace bar.swf with just a still file or a movie clip that loops..if I do this..I believe I can remove this line...will I have to modify anything else in the script?
:smoov:
-
Hi,
First tgfx,
Yes I agree that there is no need to return to the
"loading frame" if the current image set is already loaded.
It would be very easy to incorporate oyur text count
into the preloader.
I will check which way seems best for both these issues
and post back with some ideas and script.
foochuck did "example 5" answer you question or is this not
useable in your situation?? Wondering how you are going with
your script???
aaron:
I will put an example together of a multi .swf preloader and
let you know when it is completed.
Milosav
Milosav
-
Hey again guys.
Thanks to this post i've learned a buttload of new stuff. But.. I've got one tiny problem, i've got a preloader in an swf that come before my movie and it seems to work fine but it only shows up after its 20% loaded. Any idea what thats about? If you need more details just post back and i'll see what i can do. It will take me a while to get back to you as i will we at school all day tomorrow. Life's tough for a freshmen. :) Well, off to bed. :zzz:
Thanks for all your help.
Aaron
-
Milosav,
Please see my previous post to this thread...
Thanks :cool:
-
Interesting Question...?
Milosav,
I've thought of another question for you. For these techniques we're using...what about for when distributing flash movies on cd-roms or intranets...theres no bandwith problems...but I like the option of loading movies into my main movie...is there a way to do this with just one flash movie somehow...? Or perhaps when working in Macromedia Director...I've tried using the loadmovie technique in there and it doesn't seem to work...any ideas on this???
:mrpimp:
-
Hi again,
You guy's are really keeping me busy ... I am enjoying
our communications.
First foochuck:
If you look at the Bar.fla it is a main timeline that holds
a Movie Clip instance named "theBar".
The Movie Clip instance named "theBar" contains a simple rectangle.
So when we loadMovieNum("Bar.swf",4);
We are loading all of this into _level 4.
So:
_level4._invisble=false; Makes EVERYTHING on _level 4 invisible including the MC instanced called "theBar".
_level4.theBar._xscale=50; This scales ONLY the MC with the
instance name "theBar" which is on _level4.
_level4.theBar._x=200; Moves ONLY the MC instance named
"theBar" to an x position of 200.
So then:
_level4.theBar._xscale=(mcholder1.getBytesLoaded()/mcholder1.getBytesTotal())*100;
Scales the MC instance on _level4 named "theBar" to the
current percentage file loaded.
Yes you could have just about anything that you wanted as a
preloader. But you don't replace Bar.swf you open Bar.fla
open the MC instance named "theBar" and place what ever you
want in this MC. If it was an animation you would not
scale it but most probably start it at the begining of the load
with say _level4.theBar.gotoAndPlay(2); and stop it with
_level4.theBar.gotoAndStop(1);
Aaron:
Yes more details please.
1. On what frame is your pre-loader bar?
2. On what level is your pre-loader bar?
3. Where is your preloader actionscript?
ie: getBytesLoaded or getFramesLoaded stuff.
4. How large is the .swf file you are loading?
5. Are you loading other .swf files at the same time?
6. Does this happen when you are testing on the web?
Catch you
Milosav
-
Milosav,
When I load my movie and go the frame where thebar.swf is loaded into level4 this movie shows up right away and is not hidden. After I load one of the other movies it works..but I can't get this layer to hide until one of the other levels is loaded...
-
Nevermind Milosav..I found the problem..I had remade the bar.fla movie and didn't put the code:
visible=false In the first frame.
As for how these buttons are working I see that they only work when the actions for the button are in the same frame as the button. So I'm guessing this isn't a 'global' script? What I mean by this is that the script HAS to be in the same frame as the buttons in order for the buttons to work since theres no action on the buttons, but rather the actions called from the script.
-
Milosav,
I am at school right now so i can't get all the details on my preloader but i can remember most of it. Here's how i have it set up.
I've got the preloader in a seperate swf and in that i have 4 frames.
1st frame is intializing the text fields and the loader bar. (I have it set up basically like this here http://www.flashkit.com/tutorials/Ac...-689/index.php )
2nd frame is the and my bar is a bunch of script like :
Code:
_xscale=(getbytes....and so on. that works fine)
3rd frame is And all that is in the seperate swf. So I put this in my first frame of my main movie:
Code:
loadmovie("loader.swf","loadhold_mc")
-
Milosav,
I am at school right now so i can't get all the details on my preloader but i can remember most of it. Here's how i have it set up.
I've got the preloader in a seperate swf and in that i have 4 frames.
1st frame is intializing the text fields and the loader bar. (I have it set up basically like this here http://www.flashkit.com/tutorials/Ac...-689/index.php )
2nd frame is the GetBytesloaded and my bar is a bunch of script like :
Code:
_xscale=(getbytes....and so on. that works fine)
3rd frame is gotoAndPlay(2)
And all that is in the seperate swf. So I put this in my first frame of my main movie:
Code:
loadmovie("loader.swf","loadhold_mc")
I dont know what level of my movie i have my loader at. How can i find out?
Main movie Consists of : two frames (one for the main and one before that for the loader). something like 5 layers. 2 swf's loaded into the main movie(one for a nav bar and one for a little title thingy)
No, i haven't tried it on the internet yet i've just done show streaming. I dunno the size til i get home. The loader works fine but it doesn't show up til its 20% done with the whole movie. And its not a wicked huge loader so i just cant figure it out. Hope this helps a bit. One more thing. When my loader gets to 100% it just stops. But in the script of the loader i have
Code:
if(getbytesloaded==totalbytes)(or whatever the script is){_root.gotoAndPlay(2}
Should i have _level0.gotoandPlay(2) or what? I will try to zip it up and post it when i get home but class ends at 9:35 so i gotta go.
Any more q's just post
Thanks
Aaron
-
Hey Milosav..that preloader works great..everything you've explained does work great. Would you advise using a preloader like that for a regular flash movie? Perhaps loading the preloader onto a seperate level and then removing it after the movie has loaded...? If I were to use that preloader within a movie that is going to load itself, how would I go about modifying the script? Please advise.
:doughnut:
-
Milosav,
I put the whole thing together in a zip but its too big for the board so i put it in my space
http://aaronfrancis.home.mindspring.com/loadprob.zip
If there is anything missing just post back.
Thanks
Aaron
-
Hi everyone,
Aaron
thanks for the files I will have a look at them
after this post. Will get back to you after I've had a
look.
foochuck
First an earlier question. Publishing to CD.
You can use a flash Projector to publish flash on CD. Windows
or Mac. And it is a method used exstensively in marketing
material, portfolios and presentaions.
These are publish as .exe files under Windows and .projector
files under Mac. They of course are not dependent on a browser
But in the Flash Player. You can use the fscommand to change the display parameters.
ie:
fullscreen
allowscale
trapallkeys
showmenu
exec
quit
By using the Stage Object and the System.capabilities Object
You can adjust your presentation to fit the screen dimensions
resolution etc.
To publish a projector in Flash MX just chose formats from
the Publish settings and select Macintosh projector or
Windows projector.
You will then find the .exe or .projector file in the folder
with your .fla file. When you open it it will play in a Flash
projector. If you have external.swf files they are loaded in
just as usual. Of course you can really go to town if
publishing for CD ... the sky is the limit. And you may not
need any preloaders at all.
Pre-loader in movie loading itself.
If you are using a preloader in the movie you are loading or
loading it into a _level then calling it from the Movie
loading I have found that the preloader may not appear until
a little later than you might want. I have yet to find a
definitive answer to this problem as you are dealing with
connection lag, bandwidth and other such issues.
Lets say you have this set-up:
A main movie "MainMovie" which loads a preloader into _level4 and calls it to chart the loading of itself ("MainMovie") The
you will need to ensure that the preloader is fully loaded
before "MainMovie" can call it's Properties. How affective this
is I think depends on the size of your preloader.swf and the
size of MainMovie. The following script Flash MX is what you
are looking at. There are two stages stage 1: load the preloader
2: check the "MainMovie" load.
MainMovie Frame 1:
stop();
//flag variable to switch from stage 1 to stage 2
currentStage=1;
//start Loading your preloader bar.
loadMovieNum("Bar.swf",4);
//set up your interval to call your loadCheck function
//every 100 milliseconds.
loaderInterval=setInterval(loadCheck,100);
//your load checking function
function loadCheck(){
//if current stage is stage 1 then check if the preloader is
//loaded.
if(currentStage==1)
{ //check if the Bar.swf is loaded
if(_level4.getBytesLoaded()>=_level4.getBytesLoade d() &&
_level4.getBytesLoaded()>0)
{ //Bar.swf is loaded and ready to set ..so we set it.
_level4.theBar._x=200;
_level4.theBar._y=200;
_level4.theBar._xscale=0;
_level4._visible=true;
//Bar.swf is loaded so we set flag variable currentStage
//to the next stage
currentStage=2;
}
}
else if{currentStage==2)
{ //now start checking the loading of this "MainMovie"
if(getBytesLoaded()>=getBytesTotal() && getBytesLoaded()>0)
{ //everything is loaded so make your preloader bar invisible
_level4._visible=false;
//start this "MainMovie"
gotoAndPlay(2);
//stop you load checking interval
clearInterval(loaderInterval);
}
}
}
This is one method but it's effectivness could only be
found out by testing on the web.
Milosav