8 Replies Latest reply on Nov 14, 2010 3:49 PM by iconofsin14

    bytestotal/bytesloaded question

    iconofsin14 Level 1

      this.stage.loaderInfo.bytesTotal;

       

      with that line of code
      does stage mean the loading of the entire swf is monitored or the loading of objects which are used on the stage are monitored?
      can specific objects (say a specific movie clip) be targeted?
      can externally used AS scrips be targeted?

       

      and what does "this" doe

        • 1. Re: bytestotal/bytesloaded question
          kglad Adobe Community Professional & MVP

          "this" references the movieclip that contains your code.  or, if that line of code were in a function body or class, "this" could reference something other than a movieclip.

           

          and that's checking the total bytes in the main swf that loads that code.

           

          and, while all displayobjects have a loaderInfo property, that property contains info about the file that contains the displayobject.

          • 2. Re: bytestotal/bytesloaded question
            iconofsin14 Level 1

            i have seen a flash site that has a preloader at the start

             

            then while it is loaded each image has its own preloader

            i assume that the main preloader cannot mean the whole swf because if it did the sub pre-loaders would not appear.
            so what are they likely to be attatched to?

            • 3. Re: bytestotal/bytesloaded question
              kglad Adobe Community Professional & MVP

              the main swf can have a preload display (using the main swf's loaderInfo property) and each object loaded can have preload display (using the loader's contentLoaderInfo property or the urlloader).

              • 4. Re: bytestotal/bytesloaded question
                iconofsin14 Level 1

                but thats just my point


                if one pre-loader is attatched to the main swf then that would mean it waits untill the whole site is loaded!


                so how can sub pre-loaders (such as ones attatched to a specific movie clip) appear after a main preloader has been used
                • 5. Re: bytestotal/bytesloaded question
                  kglad Adobe Community Professional & MVP

                  a preloader for the main swf only "waits' until the site is loaded if it's coded to do just that.  it retrieves data about the load-progress of the main swf but other than that it only does what it's coded to do.

                   

                  if it's coded to display that load-progress, the load-progress of the main swf will be displayed.  if it's coded to prevent other code from executing until the main swf completes loading, other code will not execute until loading is complete.  if it's coded to prevent a timeline from advancing, it will do that etc.

                   

                  but i really don't think this is helping you.  you're asking general questions and you're getting general answers.  i have the feeling you would benefit more with specific information about your specific issue.  what is that issue?

                  • 6. Re: bytestotal/bytesloaded question
                    iconofsin14 Level 1

                    OK imagine this situation

                     

                    you go to a flash site and it displays a loading bar

                     

                    once the loading bar finished the site appears


                    What appears to have happened here is that the SWF has been programed to stop on the first frame until loading of the SWF is finished and then move onto the second frame (where the first page of the site is located).

                     

                    yet on the first page of the site (the second frame of the SWF and that which it is porgramed to go to when the first pre-loader compleates) there are several images which each display their own pre-loader.

                    The first pre-loader could not have been monitoring the load progress of the whole SWF file because if it had the images would have already loaded before the first page of the site appeared. so what else other than the whole swf could a preloader be monitoring the load progress of?

                    • 7. Re: bytestotal/bytesloaded question
                      kglad Adobe Community Professional & MVP

                      the first preloader monitors loading of the main swf.  that includes everything on-stage in the main swf, assets (in your main swf's library that are) exported for actionscript and includes nothing that is loaded by the main swf.

                      • 8. Re: bytestotal/bytesloaded question
                        iconofsin14 Level 1
                        function(){return A.apply(null,[this].concat($A(arguments)))}

                        kglad wrote:

                         

                        the first preloader monitors loading of the main swf.  that includes everything on-stage in the main swf, assets (in your main swf's library that are) exported for actionscript and includes nothing that is loaded by the main swf.


                        By that do you mean that the images may be stored directly in a  directory on the server, just like an image displayed by a HTML tag would be stored, and so they are "linked" to using script and so these do not get counted by the main pre-loader because they done exist in the SWF at all.