5 Replies Latest reply on Nov 28, 2007 10:24 AM by crazyjoemilan

    Nested button in mc

    jl2000 Level 1
      Hi -

      I have an FLA with movie clips that I'm using as buttons (button1, button2, etc). Inside "button4" are layers with button instances (not mc's as buttons) that make up a submenu (sub4_1, sub4_2, etc). The buttons have different looks for Up, Over, etc. Each of the buttons will have getURL's to load html pages...eventually.

      The problem is - I can't "reach" these sub-buttons. When I test the movie I don't even get the different btn states. I'll get the right reaction if I put the sub-button on the main timeline but not when it's nested in the button4 timeline. I've tried every addressing scheme I could find but still not working.

      Please - what am I doing wrong?
        • 1. Re: Nested button in mc
          crazyjoemilan Level 2
          on the root timeline, try

          trace(_root.button4.sub4_4);
          trace(_root.button4);

          or

          for ($k in _root.button4) {
          trace($k);
          }

          lemme know what it spits out.
          • 2. Nested button in mc
            jl2000 Level 1
            Hi Joe - Thanks for the reply. It said -

            undefined
            _level0.button4


            I thought I knew where this was leading so I tried:
            _level0.button4.onRollOver = function() {
            trace("gumby");
            }

            no gumby.

            thanks.
            • 3. Re: Nested button in mc
              crazyjoemilan Level 2
              undefined
              _level0.button4

              ***that means that sub4_4 doesn't exist.

              button4.onRollOver = function() {
              trace("gumby");
              }

              ***this should work if you rollOver button4 - unless of course you have button4's onRollOver's action defined twice.
              • 4. Re: Nested button in mc
                jl2000 Level 1
                Aaaargh - indeed I do!
                I've been struggling with these buttons from the outset and attached is the code that solved the first issue (courtesy kglad).

                So - what I'm learning is, since button4's onRollover has already been defined - it's not getting this other message and by extension nothing within it, like sub4_4, can be addressed. And that's why sub4_4 is not defined - even tho' it is really there.

                BTW - that other code you asked me to try (trace($k);) returned "instance7".

                So - can anything be done?

                I appreciate your help.

                JL
                • 5. Re: Nested button in mc
                  crazyjoemilan Level 2
                  BTW - that other code you asked me to try (trace($k);) returned "instance7".

                  *** that means the only movieclip inside button4 is "instance7" - which probably means you don't have the mc instance named "sub4_4"

                  So - can anything be done?

                  *** of course. Un-nest your buttons, but keep them organized. Your sub buttons can all be part of a movieClip, just not the parent you want ot attribute button-like behavior to.

                  j