PDA

View Full Version : sequential preloaders for thumbs



kdzines
May 30th, 2003, 09:19 AM
hey everyone,

I am currently working on a fashion website.

In my collection section, i want to load the thumbs sequentially and i am trying to figure out a good script to let me do this.

I looked over an fla from actionscript.org, but it's not quite suitable - and i can't figure it all out!

you can see this at:
http://www.actionscript.org/showMovie.php?id=355



So on the stage i want to have 25 container clips (called holder1, holder2, holder3, etc) and when the playhead enters that frame, i want it to load pic0.jpg into holder1, then pic1.jpg into holder2 and so on.

Can anybody help? It's important that all the code is in the main movie so i don't need to make swfs of all the pix.

i don't want to use createEmptyMovieClip or duplicate mc.

i reckon there are two ways.

1. create an array for all the pix
2. set-up some kind of counter which adds 1 everytime the previous jpg has fully loaded.

Can anyone help? I want a nice, tight code and i'm not interested in a load bar or % (besides that is easy to add later).

You can see something like this at:
www.stellamccartney.com

go to AW2003 > the collection and you'll see the thumbs load sequentially.

Please help if you can,

cheers,

Kd

eyezberg
May 31st, 2003, 03:07 AM
Maybe not exactly what you want, but check out
http://www.flashcomponents.net/component.cfm?nav=2&id=173
anyway, it's a component, so drag'n'drop and some customization is all you gotta do..

kdzines
May 31st, 2003, 07:34 AM
thanks eyez,

The component looks pretty good, but i really need to do this with my own script, as i will be applying as to the loaded thumbs to achieve further animation.

but thanks for the effort, this component might come in handy somewhere else.

cheers

RelandR
May 31st, 2003, 10:24 AM
There's a guy who has a real elaborate componant out and he just may have the tweak you're looking for... the current vers. can be seen at

http://www.actionscriipt.org ( >find > "image weaver")

and at his site he often answers ?'s about mods to it ::

http://www.buggedcom.co.uk/forum/

aurelius
May 31st, 2003, 11:58 AM
This thread might be of help, it has a preloader (as a class and as a component) that you can apply to any object:

http://www.flashkit.com/board/showthread.php?threadid=453087

kdzines
June 2nd, 2003, 09:26 AM
thanks for your help guys.

I don't see why this would be soo hard! I don't want to use components at all (don't like them very much).

I just need to figure out a way to implmenent a counter of some sort with an array.

To be honest with you, i think my biggest problem is that i am really unconfident using getBytesLoaded and getBytesTotal.

I mean if i could just target each holder mc with getBytes, then it would be no problem.

To explain what i mean:

onClipEvent(load ){
count = 0;
}

onClipEvent(enterFrame){

_root.holder[count].loadMovie ("pic" + count + "jpg");

if(count<25){

if (_root.holder[count].getBytesLoaded == _root.holder[count].getBytesTotal){

count++;
}
}
}


i know the syntax is wrong (that's kinda the problem), but do you see my thought process? Dunno if someone can write this code for me properly so it does what it should?

Your help is really appreciated,

thanks,

kd

deletedUser2352352
August 21st, 2007, 03:39 PM
I'm looking to do Something similar I don't mind using enterframes at all. What i want to do is load my images from a xml file or an array. Any help on this would be great.

what i was thinking was once the Preloader got to 1 it would then loop to the next image in the array. Would this cut down on cpu usage as well?