7 Replies Latest reply on Dec 2, 2009 3:48 PM by kglad

    preload external files into player cache? (as 2)

    ggillilandnyc

      I've created a portfolio with animated image buttons and arrows navigation (all nested movie clips).

      All navigation is handled using goAndStop() at frame labels. The site has a lot of image content, so

      to keep the initial swf download reasonably brief, I've used many separate (renamed) instances of loader component.

      I assume the loader component is just graphical substitute for typing in the loadMovie() command for people like myself who are inexperienced with scripting.

       

      With normal server traffic and T1 level bandwidth the lag time after click is 1-2 secs.

      Acceptable, but sometimes it gets up to 5+ seconds, which compromises the user experience (and might cost me a client).

       

      Is there a command string I can insert into a frame in the actions layer at the start of the timeline (after progress bar) to preload all external files into the player's cache after runtime begins?

       

      It would seem like a logical method, but I haven't been able to find anything in Adobe's reference sources that answers this question.

       

      Thanks in Advance

        • 1. Re: preload external files into player cache? (as 2)
          kglad Adobe Community Professional & MVP

          there is no preloadallmyfiles() method.  you need to encode that yourself.

          1 person found this helpful
          • 2. Re: preload external files into player cache? (as 2)
            ggillilandnyc Level 1

            To clarify, you mean this is not scriptable in using available AS commands, regardless of your level of familiarity with the language?

            (INO, not possible for non-programmers).

            • 3. Re: preload external files into player cache? (as 2)
              kglad Adobe Community Professional & MVP

              no, i didn't say that and that's not true.

               

              it's easily doable.  it's just not a one line statement with all the details handled by flash.

               

              you have to list all the files you want preloaded and generally there's strategy and coding used to do that loading in the background when bandwidth is not being used for more immediate needs.

              • 4. Re: preload external files into player cache? (as 2)
                ggillilandnyc Level 1

                OK, then, without asking you to to my thinking for me, can you point me in the right direction to learning how to do this?

                 

                Several searches both on the web and specifically in Adobe's AS reference list hasn't been that helpful. Perhaps the necessary pieces are all there, but without a roadmap to learning practical methods/strategies of stringing them together seems to be lacking. For example, preloading on a defined listener event or during a defined period of user inactivity. . . I know what I want to do, but can't find the methods so far.

                 

                Incidentally, like many people, circumstances force me to learn the process backwards (i.e.: get a portfolio up a.s.a.p., look for work, and learn coding after the fact).

                • 5. Re: preload external files into player cache? (as 2)
                  kglad Adobe Community Professional & MVP

                  how you should do this will depend on your setup.

                   

                  but the most common way would be to wait until the initial assets needed to display your website have loaded, then call a function that sequentially loads the most likely next-needed assets. that's the easy part and the hard part.  it's easy to set this up but whether this is going to be helpful or a drawback depends on how good you were at predicting the next-needed assets.  that's because with as2 you can't stop loading an asset.

                   

                  so, if the user does something that changes the next-needed asset, you'll be stuck loading two objects at once - the most likely next-needed  and the next-needed.  that will slow the loading of the next-needed so you want to be careful about how you do this.

                   

                  p.s.  this is one area where as3 is superior.  you can stop loading after it's been started.

                  1 person found this helpful
                  • 6. Re: preload external files into player cache? (as 2)
                    ggillilandnyc Level 1

                    Thanks.

                     

                    I think I painted myself into a hole here, as I provided the user with two options: back and forth arrows (next image/previous image) as well as a menu of image buttons that can be selected at random:

                     

                    ggillilandnyc.com    

                     

                    It appears a preloading strategy will be a difficult.  I think I'll chalk this one up as a learning experience and move on. I have an Adobe's AS 3.0 text book on the way. Once this is up I'll read it carefully and reevaluate my practices.

                    • 7. Re: preload external files into player cache? (as 2)
                      kglad Adobe Community Professional & MVP

                      you're welcome.

                       

                      if you use as3 you don't even have to be that clever.  you can just start preloading things that might be needed and if the user requests something that's not already been preloaded, you can stop the currently loading object, pause the preloading sequence, load the user's requested item and then after the user's item has completed loading, continue your background preloading.  the user won't notice any delays and will see a benefit each time a requested item has already been preloaded.