Following Ray Chuan answer: Thanks for your initiative, but I'm not THAT newbie :) The question here is other:
If you have, for example, 100 photos, and have different two ways of loading them: Load them all at the same time using MovieClipLoader; Create a QueueLoader class, and start loading one at a time. When loading finishes, start loading the next. In theory, the number of bytes loaded is exactly the same, so, for the same bandwidth, the total time for loading all photos should be the same. But for the user, it looks faster the QueueLoader, because obviously it's faster to load and show one photo with 256 kb (256 kb at 2Mb, takes 1 second) show it and load next, than to load all the photos at same time (100photos*256kb=256000kb, takes 100 seconds). But the question here is that comparing both methods, we could say that "for user experience, QueueLoader is better, but they both take the same time". But by some reason, this is false: QueueLoader seems to be a bit faster, but I can't find any explanation. I guess it's not because of download time, but rendering time: if you load one photo, start loading next, and render the first, render and loading are done at the same time. If you load them all, and render them almost at the same time, may cause the Flash Player to slow down a bit. This is my bet. When I finish the current project, I will try to create a QueueLoader class (nothing new here) that solves the bug (this is the new thing) of onLoadInit not being called when the movie clip holder was deleted before download finishes. My best bet (already tried) was to use the onUnload event of MovieClip. But not only it doesn't work as supposed, as also it has a strange behavior some of the times (maybe because of flash garbage collector: if you remove a movieclip, and create another with the same name, or something like this). My second bet, was to create a special QueueItemHolder, that could only be deleted by calling a method that checks if content is already loaded. This solves the problem when removing QueueItemHolders of the screen, but if you remove QueueItemHolder _parent, the problem remains. If anyone has ever had this bug, and solved, or tried to solved it and acquired some experience with it, please, let me know. I do not want to re-invent the wheel :o) Just another subject here: i think there should be a way for better categorize mails on the OSFlash ML. Sometimes, we send a mail with some subject, but after some discussion, the content of the mails has less to do with the subject, in spite of following the previous answers. Sometimes it's boring when looking for an answer on the ML archive, and the answer on "how to cook pineaples" in on the topic "making an airplane". Do you have any suggestion? Changing the subject, when the discussion "changes"? :| João Saleiro -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ray Chuan Sent: terça-feira, 6 de Junho de 2006 17:17 To: Open Source Flash Mailing List Subject: Re: [osflash] Important questions for future robust web-applications development Hi, On 6/6/06, João Saleiro <[EMAIL PROTECTED]> wrote: > If you try to load one image at a time, overall download time is a bit > smaller than if you try loading them all at once, if you are talking > on hundreds of photos. I don't have an explanation, but when I have > time to create the referred class, maybe I'll found out why. This can be explained using simple mathematics. time = size/speed where time is the downoad time, size is the total bytes to download, and speed is the download speed. Let's assume speed is more or less constant. If size is small (one photo at a time), time is small. If size is large (hundreds of photos), time is large. > João Saleiro > > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of [EMAIL PROTECTED] > Sent: terça-feira, 6 de Junho de 2006 3:27 > To: [email protected] > Subject: Re: [osflash] Important questions for future robust > web-applications development > > > MovieClipLoader is sh*t > > Agreed. Image loading in Flash in general is something that gave me a > lot of trouble. I built this photo kiosk (daypix.com) for the Flash 6 > player without MovieClipLoader. It resells holiday photos. The vendor > doesn't know anything about the people in the photo, except the day > and tour they where on. So any given thumbnail display has to preload > load hundreds of pix for the client to page through quickly. If they > get bored waiting for other peoples photos to load before they can find their own then the sale is lost. > > I found the flash player a _lot_ slower than simply loading the pix > into the browser with HTML and I had to do a lot of messing around to > offset it, so I too would be really interested in hearing about best practice in this area. > > > I know there are solutions > > Please share the ones you have in mind. > > > if you remove the movieclip from the stage before the resource is > > loaded (and that happens a lot, especially if you have a nervous > > user using your application :o) ) the Queue loader crashes (resource > > is loaded, but onLoadInit is not called and no error is thrown). > > How about checking if the image has loaded before trying to delete it. > If it hasn't loaded hide it offstage ({_x:-1000, _y:-1000, _alpha:0}) > and set a deleteMe flag that onLoad will check. > > I never figured out the optimal number of images to load > simultaneously, my load queue default was 5. Trying to load a lot at > once didn't seem to help speed wise and like you say the load can't be stop once it's requested. > > Tony > > > _______________________________________________ > osflash mailing list > [email protected] > http://osflash.org/mailman/listinfo/osflash_osflash.org > > > _______________________________________________ > osflash mailing list > [email protected] > http://osflash.org/mailman/listinfo/osflash_osflash.org > -- Ray Chuan _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org _______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
