7 Replies Latest reply on Feb 8, 2011 11:59 AM by Ned Murphy

    Preloader to load only half or part of movie

    EricFight

      I'm using as2 and i'm making a photogallery. I have a preloader but its taking too long to load, so is there a way where i can pick how much i want it to be loaded before it starts so the viewer doesnt sit there forever? Maybe a quarter loaded or half.....???....Here's the code im using now to do this.

       

      if (_framesloaded>=_totalframes) {
      gotoAndPlay (14);
      } else {
      gotoAndPlay (1);
      }

        • 1. Re: Preloader to load only half or part of movie
          Ned Murphy Adobe Community Professional & MVP

          Have you tried using a divider for the _totalframes value to see if it will work as desired for you?  (as in...   if (_framesloaded>=_totalframes/4)   )

           

          I'm not saying it will, but wondering if you've tried before asking.  The best way to avoid making foks wait is to create a dynamic design that loads heavier things like images and sounds dynamically.

           

           

           

          • 2. Re: Preloader to load only half or part of movie
            EricFight Level 1

            i'm rather new to this...this seems to work just fine. the way you just told me. But it seems that my file is pretty large.14158387 <<<size...

            So im not sure what u mean when you say:

             

            "The best way to avoid making foks wait is to create a dynamic design that loads heavier things like images and sounds dynamically."

             

            Could you explain this to me, or show to do it. Sorry, i know i still have a lot to learn.

            • 3. Re: Preloader to load only half or part of movie
              Ned Murphy Adobe Community Professional & MVP

              It's better to make galleries that easily allow for the addition of new content and the removal of old content, without the need to modify the gallery design. This approach can make your current 14MB file drastically drop in size... to something as low as only 20KB (0.02MB).

               

              Such a gallery will load the content that it displays dynamically, meaning the images that are shown in the gallery are not actually contained in the gallery file.  They are loaded in when the file asks for them, and not necessarily all at once when things first start.  It could load each image on request, or maybe a section of them at a time.

               

              Usually a separate text file (often xml formatted) is used to list which images belong in the gallery, and that file is what gets updated to add/remove the images that will be displayed.  It can be edited using a simple text editor like Notepad, which makes it easy for anyone to maintain their gallery.  It will contain the path to the images on the server as well as any text information that might be used to label or describe each image.

               

              Your best bet for learning how to design something of this nature is to search Google for a tutorial.  Use search terms like "AS2 xml gallery tutorial".

              • 4. Re: Preloader to load only half or part of movie
                EricFight Level 1

                Thanks alot Ned, I will check it out and get back with you. Very helpful

                • 5. Re: Preloader to load only half or part of movie
                  Ned Murphy Adobe Community Professional & MVP

                  You're welcome.  You will not regret giving this a shot.  It opens up new doors for you.

                  • 6. Re: Preloader to load only half or part of movie
                    EricFight Level 1

                    Ned, i have seem to find tutorials in as3 but not in as2. Also most of them dont mention how to use a

                    next & prev button in order to move from pic to pic. What i want is you can go load the menu...where u can pic what category of pictures u want to look at, then click the category and then each time you hit next it dynamically loads the the next pic so the file doesnt take forever to load. Do you by chance know of a tutorial that you would reccommend? I will have to re lay my whole gallery out if i switch to as3?

                    • 7. Re: Preloader to load only half or part of movie
                      Ned Murphy Adobe Community Professional & MVP

                      You may need to view a couple to get what you want exactly, but the key to getting what you want exactly involves learning what goes on in designing them, not just copying what they do (and wondering why they don't do what you want).

                       

                      If you use the search terms I identified there are several results for AS2 dynamic galleries.  Here are two of them that display features that you mentioned wanting.  THe first will show you how to implement the next and previous buttons, and the second will show you how to make the different sections selectable.

                       

                      http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
                      http://www.flashexplained.com/img/dynamic-image-gallery-example.html