author: mga [+], Submitted: 03.16.03 4p • Last Edit: 01.17.08 1p
Avg. Rating: 4

usage

msg1 { mga [+], posted: 03.27.03 1p•-, top [^] }
Hi

Posted a "translated" version and a sample here:

http://www.alleati.com/mga/proto/sample_loader.html

I think it is more comprenhensible now :)

-mga
msg2 { diabolika [+], posted: 06.24.03 1a•-, top [^] }
I sure would like to find a bare bones universal Preloader Prototype for externally loaded assets, but this one looks impressive.
msg3 { mga [+], posted: 06.24.03 8a•-, top [^] }
what do you mean by barebones?
msg4 { diabolika [+], posted: 06.24.03 12p•-, top [^] }
By Bare bones, I mean easy to implement. Also not scripted for dynamically attaching it, or parsing "type" of file loaded etc....
I've been trying to retro-fit a universal asset preloader from the book "Flash MX Bible" but it also attaches a "holder" MC from the library and uses "#include loadfile.as" and in general is pretty specific to the example that they are presenting in the book.

I'm loading movies into _level2 with one button and a simple dynamic textfield MC for the numbers, both items already on the stage.

One problem I have is that the "clearInterval(time)" is never called, the load is never satisfied as 100% by the "if" statement even though the dynamic text field reads 100%?

Also, as an "Object", what is _level2 called? Would it be targeted as "_level2" or "car.swf"?
They call their loader "checkLoad(obj)", is this a user defined function or a predefined function?
Is the (obj) user defined or predefined? And, how does that relate to my above _level2 question?
As you can tell, I am in a state frustration because of my lack of knowledge but also the books are somewhat vague when I try to solve some of the semantics of these terms.
mg-

msg5 { mga [+], posted: 06.24.03 2p•-, top [^] }
hmm...
so you would prefer dynamically created 100% and not dependant of pre-existing movie clips?

the idea of the movie clips in this option is that you can have "templates" with which you can have different visual options when loading different movies. you can see in elefectoaxe.com.co that the page itself has a -very- big loading sign but the thumbnails have a small one. besides, dynamically scripting everything has certain benefits such as portability (copy paste code... no strings attached) but with this other option it is very easy to implement new designs in no time...

i am not familiar with the Bible (not a religious person) so i could comment on that sample. if you could send a link or something for me to check out and see how my prototype could help.

- mga
msg6 { diabolika [+], posted: 06.24.03 3p•-, top [^] }
Acually, I think this is the problem with most scripts if you already have your design in place.
To use your script (as wonderful as it is), I would basically need to completely redesign my project. My external swf's have already been created and sized to fit this project on _level2 while keeping the other stage elements working etc.... It's all a design issue. I have the design complete, with elements in place on the stage.
I merely need to have a script that accurately displays the percent loaded of the new loaded movies in my text field and successfully clears the setInterval() when completed. Sounds so simple, yet I have been toying with this for a week.
I've read many other Flash users laments and the time they spend solving problems that are essentially fairly easy to solve also. I'm not sure why it's so difficult to actually find the information we need but the productivity lost around the world with problem solving is mind boggling.
I've not seen any successful forums that were correctly searchable, everyone asks the same questions about the same issues over and over. I have no doubt my questions have been asked and answered thousands of times somewhere, but where?
This site is the best so far, I've already solved a handful of problems and procured some very usefull scripts.
Thanks for your replies.
mg-
msg7 { mga [+], posted: 06.24.03 5p•-, top [^] }
i think this proto can help you...

it will displaye % loaded.
it will clear interval (it does not use setinterval)
it will return an event when each photo is loaded and when all photos have been loaded.
it can load stuff in _levelX (need to make some adjustments though)

it could be a nice enhancement to the current proto

if you want to you cand send a link so i can see the current need

- mga
msg8 { diabolika [+], posted: 06.24.03 7p•-, top [^] }
Sure-
I will take a look at your offering, thanks!



The project I have going is a personal site for a client, they have a very fast connection so file size was not an issue for this one. www.jamescousens.com
On the "Machines" page of the jamescousens.com site I have 4 buttons that LoadMovie() into _level2. Each swf loaded is between 100-200kb. Having no preloader is not much of a problem for my client but with my Dial-up connection it feels like it needs one.
Naturally, if I can sort one out and implement it without major surgery that would be best.
Diabolika
msg9 { mga [+], posted: 06.26.03 5p•-, top [^] }
ok

made a few changes: still "backwards compatible"

i noticed in your site you have a "loading" text. you could replace it with a simple clip that has 4 things:
- status_txt text field
- text field with "porcentaje" variable assigned
- barra_mc clip for progress bar
- borde_mc clip for max width of progress bar

the 4 elements are actually optional. you just need a clip existing in your current movie (Class depends on an onEnterFrame and i'd rather not attach it to _root for obvious reasons)

for loading in _level just replace the receiver clip with "_levelX" where X is a number and thumbnail clip with "clip_name" [without quotes] for a reference to the place where progress will be displayed. also check the demo in http://www.alleati.com/mga/proto/sample_loader.html for more info.

- mga
msg10 { diazangulo [+], posted: 01.17.08 10a•-, top [^] }
Hola podrías mandarme un zip con archivos muestra que ya me hice pelotas

Saludos.
msg11 { mga [+], posted: 01.17.08 1p•-, top [^] }
msg12 { diazangulo [+], posted: 01.17.08 1p•-, top [^] }
muchisimas gracias lo probé y me funciona muy bien.


Para pregargar un swf en el nivel 1, cuando estoy precargando el del nivel 0, como le hago?

Saludos
msg13 { mga [+], posted: 01.17.08 1p•-, top [^] }
si está cargando en un level, debe escribirlo entre comillas en lugar del clip: "_level22" en lugar de base_mc... hice este prototipo hace varios años y poco lo usé con levels así que no recuerdo muy bien ese caso...
msg14 { diazangulo [+], posted: 01.17.08 2p•-, top [^] }
pero por ejemplo, si quiero precargar varias peliculas en varios niveles?
digamos 1.swf en el nivel 1
2.swf en el nivel 2 etc.
msg15 { diazangulo [+], posted: 01.17.08 2p•-, top [^] }
ya pude, agregas lineas de actionscript por cada nivel

var picts = new Loader ("",[{archivo:"1.swf"}],"_level1","load_main2",0,0,100,85,4);
picts.init();

var picts2 = new Loader ("",[{archivo:"2.jpg"},{archivo:"3.jpg"},{archivo:"4.jpg"},{archivo:"5.jpg"},{archivo:"6.jpg"},{archivo:"7.jpg"}],base_mc,"load_main",0,0,100,85,4);
picts2.init();