3 Replies Latest reply: Apr 14, 2012 11:42 AM by Ned Murphy RSS

    Newbie Question

    AndreasZach

      Hello, I was wondering how do you express hierarchy? I want to affect the visibility of a symbol in a group inside another group on one of my layers, thanks.

        • 1. Re: Newbie Question
          Ned Murphy CommunityMVP

          THe groups will have to be in the form of movieclips.  If group1 is the name of the movieclip that contains the group2 movieclip, and group2 contains the movieclip symbol, then to target that symbol from the group1 timeline you can use...

           

          group1.group2.symbol.visible = true;  // or false

           

          Where those are instance names assigned to the objects on teh stage.

          • 2. Re: Newbie Question
            AndreasZach Community Member

            same goes to assign the layer? meaning if a symbol on layer 1 affects the visibility of symbol2 when clicked, symbol2 being on layer2 in group1.group2. ... 

            • 3. Re: Newbie Question
              Ned Murphy CommunityMVP

              Layers are irrelevant to actionscript.  They provide you with options as to how to arrange objects but cannot be affected by code, although you can rip an object out of a layer using code (addChild()) disconnects an object from its parent timeline).

               

              The only way you woukld affcet the visibility of symbol2 if you attacked symbol1 would be if symbol2 was inside symbol1