8 Replies Latest reply on Jun 7, 2009 4:29 PM by Ned Murphy

    Argh! Double button!

    Geijutsuka-sama

      Hello-

       

      I've looked through threads on this same topic, but I can't get my question answered...

      I'm trying to put an "invisible" button under part of a large button, but if I put it under the larger button, the invisible button doesn't work. If I put it on top of part of the large button, the large button doesn't work... Is there some way to make it so that both the buttons work...?

      Thank you for any help you can provide...

        • 1. Re: Argh! Double button!
          Ned Murphy Adobe Community Professional & MVP

          Cam you explain a little more about this situation.  How big is the invisible button?  What are you trying to do (besides put one button on top of another and have them both work)?

          • 2. Re: Argh! Double button!
            Geijutsuka-sama Level 1

            Ok, here's the deal:

            I have a bar graph that has different categoies of colored bars in it. I want it so that when a user cursors over a bar of a particular color, all the bars with the same color get a drop shadow; but I also want some text to appear explaining only that one particular bar- and the text should change depending on which specific bar the user is cursoring over... I hope this is making sense. I want all the bars of a particular group have the same reaction to a mouse over (no matter which one bar has a mouse over it), but I want each one of those bars to have a specific response if the cursor is over it.

            • 3. Re: Argh! Double button!
              Ned Murphy Adobe Community Professional & MVP

              Create the bars as movieclips so that you can animate them as a group based on something similar about each one (like a variable they hold).  You can use a function with a for loop and test all bars for the variable held by the movieclip that was interacted with and have all movies that have that value animate.  You can have the one that received the mouse event display its text.

               

              The approach could be slightly different depending on which version of Actionscript you are using.

              1 person found this helpful
              • 4. Re: Argh! Double button!
                Geijutsuka-sama Level 1

                I hate to say this... I'm not too sure I follow you. My action script skills are really rusty (using 3.0 by the way). Could you possibly elaborable on your explanation? I very much appreciate the help!

                • 5. Re: Argh! Double button!
                  Geijutsuka-sama Level 1

                  Ok, since last night, I've learned how to make this work with buttons inside of a movieclip, but I'm not sure how to make the dropshadow dissapear on the MOUSE_OUT event.

                  This is my code so far (I've commented out the code which I can't get to work properly):

                   

                  var dropShadow:DropShadowFilter = new DropShadowFilter();
                  dropShadow.blurX = 3;
                  dropShadow.blurY = 3;
                  dropShadow.distance = 5;
                  dropShadow.strength = 75;

                   

                  function transOver(event:MouseEvent):void {
                      trace("transmain_btn overstate");
                      transmain_btn.filters = [dropShadow];
                      transmain_btn.filters = [new DropShadowFilter()];
                  }

                   

                  /*function transOut(event:MouseEvent):void {
                      trace("transmain_btn back to normal");

                      but what goes here to make the drop shadow go away?
                  }*/

                   

                  transmain_btn.addEventListener (MouseEvent.MOUSE_OVER,transOver);
                  //transmain_btn.addEventListener (MouseEvent.MOUSE_OUT,transOut);

                   

                  transmain_btn.buttonMode = true;

                   

                  **************

                  I'm so close to getting this to work!

                  I've attached a mock-up .swf file to help visualize how mush I have done (the original file is at my work, and I can't send it). Only the first brown bar in the graph works right now (but the text- of course- also has a drop shadow... I wonder if there's any way to get rid of it...)

                  • 6. Re: Argh! Double button!
                    Ned Murphy Adobe Community Professional & MVP

                    Try:  transmain_btn.filters = [];  or transmain_btn.filters = null;

                     

                    I had shut down before your followup last night, so it's good to know you got something working.  There's lots of ways to approach solution in Flash.

                    • 7. Re: Argh! Double button!
                      Geijutsuka-sama Level 1

                      Yes!

                      That did it! It works now!

                      I figure I'm going to put a block behind the feedback text so that it's not so hard to read.

                      Thank you so much Ned!

                      • 8. Re: Argh! Double button!
                        Ned Murphy Adobe Community Professional & MVP

                        You're welcome