4 Replies Latest reply: Apr 3, 2011 2:09 PM by barpos RSS

    meaning of traceDisplayList() output?

    barpos Community Member

      Hi,

       

      Here's what that custom class reports (I can't make out where the bold lines come from -- no such thing on the stage or anywhere else in my document):

       

      -------------------------------------------------------------

      [object MainTimeline__Preloader__] root1
           [object Shape] instance1
           [object Loader] instance2
               [object MainTimeline] instance3
                   [object MovieClip] anim_mc
                       [object Shape] instance4

           [object Loader] instance7
               [object MainTimeline] instance8

                   [object MovieClip] backBuilding
                      [object Shape] instance9
                   [object SimpleButton] FullScrnBtn
                   [object SimpleButton] Machining_Btn
                   [object SimpleButton] Welding_Btn
                   [object SimpleButton] SnowBlade_Btn
                   [object SimpleButton] Engineering_Btn
                   [object SimpleButton] Company_Btn
                   [object SimpleButton] Contacts_Btn
                   [object MovieClip] __id0_
                   [object TLFTextField] TraceTxt
                       [object Shape] instance114
                       [object Sprite] instance115
                           [object SimpleButton] instance116
                           [object TextLine] instance118

                   [object MovieClip] instance10
                   [object MovieClip] __id1_

                   [object TLFTextField] CompanyName
                       [object Shape] instance120
                       [object Sprite] instance121
                           [object SimpleButton] instance122
                           [object TextLine] instance124
                               [object Shape] instance125

                   [object MovieClip] instance11

      ---------------------------------------------------------------------

       

      Where can I find detail explanation how what to expect from a display object list?

       

      ---------------------------------------------------------------------

       

      Here's the code for the traceDisplayList() class:

       

      package
      {
          import flash.display.DisplayObjectContainer;
          import flash.display.DisplayObject;
          public class traceDisplayList
          {
              public function traceDisplayList(kontainer:DisplayObjectContainer,indentString:String=""):void
              {
                  traceF(kontainer,indentString);
              }

       

              private function traceF(kontainer:DisplayObjectContainer,indentString:String=""):void
              {
                  {
                      var child:DisplayObject;
                      for (var i:uint = 0; i < kontainer.numChildren; i++)
                      {
                          child = kontainer.getChildAt(i);
                          trace(indentString,child,child.name);
                          if (kontainer.getChildAt(i) is DisplayObjectContainer)
                          {
                              traceF(DisplayObjectContainer(child),indentString + "\t");
                          }
                      }
                  }
              }
          }
      }

        • 1. Re: meaning of traceDisplayList() output?
          Ned Murphy CommunityMVP

          If this is a custom class written by someone and provided for public use, then the answer to your questions about what it is for probably lies in whatever writeup that person provides where they make this class available.  Otherwise, what you see is what you get, a hierarchy-indented list of all the objects (each one's data type and instance name) found in whatever container object that was passed into the function.

          • 2. Re: meaning of traceDisplayList() output?
            kglad CommunityMVP

            you're tracing the displayobject, displayobject.name and all its children.

            • 3. Re: meaning of traceDisplayList() output?
              barpos Community Member

              Well, the sample code provided came with the suggestion to pass "stage' as parameter.  With "this" instead, the trace report listing makes more sense.

               

              [object MovieClip] backBuilding
              [object MovieClip] __id0_            // no such movie clip on my stage
              [object TLFTextField] CompanyName
              [object MovieClip] instance10     // no such movie clip on my stage
              [object SimpleButton] FullScrnBtn
              [object SimpleButton] Machining_Btn
              [object SimpleButton] Welding_Btn
              [object SimpleButton] SnowBlade_Btn
              [object SimpleButton] Engineering_Btn
              [object SimpleButton] Company_Btn
              [object SimpleButton] Contacts_Btn
              [object MovieClip] __id1_          // no such movie clip on my stage
              [object TLFTextField] TraceTxt
              [object MovieClip] instance11   // no such movie clip on my stage

               

              It's only my two text fields (CompanyName & TraceTxt) on the stage that make absolutely no sense.  Three lines for a single object.  This has a be a Flash bug (not that the bug is animated <g>).

               

              If I remove my two text fields from the stage, I get the following display list:

               

              [object MovieClip] backBuilding
              [object SimpleButton] FullScrnBtn
              [object SimpleButton] Machining_Btn
              [object SimpleButton] Welding_Btn
              [object SimpleButton] SnowBlade_Btn
              [object SimpleButton] Engineering_Btn
              [object SimpleButton] Company_Btn
              [object SimpleButton] Contacts_Btn

               

              Regards,

               

              Ron

              • 4. Re: meaning of traceDisplayList() output?
                barpos Community Member

                If I convert my TLF text fields to Classic text fields, everything is fine!  So, that's what I'll do ...

                 

                Regards,

                 

                Ron