Flash Preloader / NO LoadMOVIE!?
- Started
- Last post
- 21 Responses
- Scallywag
Does anyone know if you can make individual movieclips on the timeline have preloaders without bringing in (loadMovie) and external SWF? Ie I'm sick of having 5 windows open when I could be doing it in the main timeline or above. Is this making any sense? I'll elaborate more if need be....
AirCushionedBalloon®
- ********0
I reckon I might need an elaboration.
In my mind, preloading isused to bring in external data (swfs, jpegs, whatever). Loading an extrnal file sort of means that you will need to have authored this file in a seperate window/application to begin with, right?
- unfittoprint0
you could make a preloader MC, and within it a function that targets a loaded MC in the Stage.
loadMC = function(target){
textbox.text = Math.round(target.getBytesLoaded...
if (target.getBytesLoaded() == target.getBytesTotal() && target.getBytesTotal() >10)
clearInterval(loadLoop);
this.removeMovieClip()
}
}startLoad = function(target){
clearInterval(loadLoop);
loadLoop = setInterval(this, "loadMC", 30, target);make
loadMC = function(target, path){
target.loadMovie(path);
this.attachMovie("preloader","pr... 666, {target:target});
}//usage exemple
loadMC(this.holder, "content/myMovie.swf);
- ********0
as usual unfittoprint has successfully given you the best way to do it with AS.
- Scallywag0
aaah thanks unfittoprint.. but you're still using loadMovie to bring in a swf.. What I meant was can you make a preloader on a MC, ie whats INSIDE that movieclip preloads without the use of External swfs....
AirCushionedBalloon®
- unfittoprint0
if the MC is already inside your main movie it's er.... already loaded.
- ********0
that's exactly what I thought...but default, anything that's preloaded is created externally.
- Jerry0
You can use a preloaer to preload an extrenal swf as well as the main movie itself.
The problem is that when you preload the main movie the framerate of the movie can be slower than the internet connection you have. This means that you might be preloading at a certain point on your timeline something that has already been loaded.
But it is possible.
success
- unfittoprint0
the problem is that if you have linked MC's, sounds and font symbols in your library, those will be exported in the first frame. And your preloader will only appear after those are cached in the user's machine.
kinda useless.
- Jerry0
I know there is a workaround for the linked items stored in your library.
However, the question was, how to preload movieclips from the main timeline. It's pretty hard because of timing issues but it's definately possible.
- tomkat0
"I know there is a workaround for the linked items stored in your library."
Jerry
(aug 3 04, 02:47)yes? tell me about it. : )
- unfittoprint0
I remember trying a workaround long ago, but came to conclude that for various reasons [not only preloading, but also code protection] having a small file to serve as holder/preloader is much more logic.
Another thing: make all your project assets [common fonts, symbols, sounds] available in only 1 external library. That will make your project much, much smaller and faster to load.
- Scallywag0
yes please do!
AirCushionedBalloon®
- Scallywag0
was repsonding to tomkat.. cheers unfittoprint!
- Scallywag0
unfiittoprint.. Why an external file for al the assets?
- Jerry0
I agree on that unfittoprint.
The workaround I have been using, was also a looong time ago. I can't quite remember where I left it. But if I find it I'll post it, promissed. 8)
cheers
- Scallywag0
I mean external library.. Do you link to swfs in that fron the main movie? I'm slightly confused but understand the preloader now..
- Scallywag0
sorry I'm anoying now.. but how do u link to an external library from within your main mc?
- unfittoprint0
Imagine, you have multiple external files that use the same font, movieclip and sound symbols. If you have all of them [including the main movie] linking to an external library, thos extra kb will disappear from each external mc's, making everything lighter and faster.
And the most important thing: instant updating - you change one item in the library nand it reflects in the entire project.
more info here:
http://www.macromedia.com/suppor…
- Jerry0
Another little off-topic question. I've noticed that there ara a lot of flash related questions lately. Are the any people interested in starting some sort of code depot aka knowledge base kind of site. Maybe a bit like the flashcoders wiki or layer51?
I know i have lots of code and samples to contribute. And i think people like unfit as well. Any ideas anyone?
- Bozilla0
Well to tell you the truth I personally wouldn't contribute to that at all...fast code tips through portals like this I can do, but I started getting sick and tired of writing other people's code. I mean come on, everyone is making money and in most cases I'm writing the project for them. I don't wanna sound like a dipstick here, but nobody helped me when I wanted to write my own code for anything. I had to read and read and read. So in essence you will find that most experts in this field are starting to feel the same. So I don't know how successful that site would be in contribution. I think you would end up having another FlashKit.com and what's the point in that.
As far as preloading internal objects that are contained withing the main timeline, it's almost impossible to do that because when MM extended Flash they didn't have that thing in mind. You can try checking if a certain frame is loaded and still keep playing the main timeline, until it reaches that frame..but you can't skip frames (ie. you have MC on frame 3 and you say load frame 5, but you want to keep frame 4 out of memory. That's not possible.) That's where loadMovie comes in (though it's obsolete these days). You just load external asset to a MC holder as unfit mentioned so you can have better control..