4 Replies Latest reply on Jan 13, 2010 5:02 AM by Ned Murphy

    mouseover blur menu

    Metilic

      hey, can someone help me with this : i have 4 photos and when i put mouseover 1 picture i want the other 3s to blur.(i want them to be buttons)

        • 1. Re: mouseover blur menu
          Ned Murphy Adobe Community Professional & MVP

          Try the following (this is using AS3 code), where each photo is a button symbol with the names btn1 thru btn4...

           

          var blur:BlurFilter = new BlurFilter(10, 10, 1); // set up blur properties

           

          btn1.addEventListener(MouseEvent.ROLL_OVER, blurThings);
          btn2.addEventListener(MouseEvent.ROLL_OVER, blurThings);
          btn3.addEventListener(MouseEvent.ROLL_OVER, blurThings);

          btn4.addEventListener(MouseEvent.ROLL_OVER, blurThings);

           

          btn1.addEventListener(MouseEvent.ROLL_OUT, unblurThings);
          btn2.addEventListener(MouseEvent.ROLL_OUT, unblurThings);
          btn3.addEventListener(MouseEvent.ROLL_OUT, unblurThings);

          btn4.addEventListener(MouseEvent.ROLL_OUT, unblurThings);

           

          function blurThings(evt:MouseEvent):void {

           

                // blur all of the buttons
                btn1.filters = [blur];
                btn2.filters = [blur];
                btn3.filters = [blur];

                btn4.filters = [blur];

           

                // make the rolled over button clear
                evt.currentTarget.filters = [];
          }

           

          function unblurThings(evt:MouseEvent):void {

           

                // clear up all buttons
                btn1.filters = [];
                btn2.filters = [];
                btn3.filters = [];

                btn4.filters = [];

          }

          • 2. Re: mouseover blur menu
            Metilic Level 1

            thnx a lot, it's working excelent.

            • 3. Re: mouseover blur menu
              Ned Murphy Adobe Community Professional & MVP

              You're welcome

              • 4. Re: mouseover blur menu
                Ned Murphy Adobe Community Professional & MVP

                As long as that's what you were looking for, here's the less wordy version if you used the naming scheme I described...

                 

                var blur:BlurFilter = new BlurFilter(10, 10, 1); // set up blur properties


                for(var i:uint=1; i<5; i++){

                    // assign event listeners
                      this["btn"+String(i)].addEventListener(MouseEvent.ROLL_OVER, blurThings);
                      this["btn"+String(i)].addEventListener(MouseEvent.ROLL_OUT, unblurThings);
                }


                function blurThings(evt:MouseEvent):void {


                      // blur all of the buttons
                      for(var i:uint=1; i<5; i++){
                             this["btn"+String(i)].filters = [blur];
                       }


                     // make the rolled over button clear
                      evt.currentTarget.filters = [];
                }


                function unblurThings(evt:MouseEvent):void {


                      // clear up all buttons
                      for(var i:uint=1; i<5; i++){
                             this["btn"+String(i)].filters = [];
                      }
                }