3 Replies Latest reply on Feb 16, 2010 7:35 PM by Harry Kunz

    Menu gets hung up

    bboothe1107

      In the attached file, for some reason, when the menus drop down, they frequently get hung up.  (stay down, slow to move back up into the hidden position, etc.)

       

       

      I really need to correct this as this will be the main website for our school district and I need it to look professional.

       

       

      Any help is greatly appreciated.

       

       

      Thanks.
        • 1. Re: Menu gets hung up
          Harry Kunz Level 4

          I cannot find your code causing the menu drop down. I can only see the code for mouse down event. I suggest you consider revising your code. You should keep your code as centralized on the main timeline as possible. Do not place code in other timelines as this can get really messy and difficult to maintain in the future.

          • 2. Re: Menu gets hung up
            bboothe1107 Level 1

            Harold,

             

             

             

            Thanks for replying.  All of the code is under Scene 1:  Actions, Frame 1.  I designed this from a tutorial and I'm quite the novice.  I just don't have a good enough grasp of why the menus don't pull back up as they should.

             

             

             

            Any help is appreciated.

             

            Date: Sun, 14 Feb 2010 20:16:01 -0700

            From: forums@adobe.com

            To: bboothe@live.com

            Subject: Menu gets hung up

             

            I cannot find your code causing the menu drop down. I can only see the code for mouse down event. I suggest you consider revising your code. You should keep your code as centralized on the main timeline as possible. Do not place code in other timelines as this can get really messy and difficult to maintain in the future.

            >

            • 3. Re: Menu gets hung up
              Harry Kunz Level 4

              Ooops, i was looking at the end of the timeline, didn't know i could scroll left to see frame 1. I'm not sure exactly to as why the Mouse out event listener is slow on capturing a mouse out event. If you do a slow mouse out it works while doing it fast it cannot capture sometimes. I revised your code to use the ENTER_FRAME instead and do a check if the mouse goes beyond the Rect area a mouse out and it yields perfect results.

               

              Replace frame 1 with this code instead:

               

              import fl.transitions.Tween;

              import fl.transitions.easing.Regular;

              import fl.transitions.easing.Elastic;

               

              Menu_Cont.District_Rect.alpha = 0;

              Menu_Cont.District_Btn.addEventListener(MouseEvent.ROLL_OVER, DistrictRollOver);

               

              Menu_Cont.School_Board_Rect.alpha = 0;

              Menu_Cont.School_Board_Btn.addEventListener(MouseEvent.ROLL_OVER, SchoolBoardRollOver);

               

              Menu_Cont.Parents_Rect.alpha = 0;

              Menu_Cont.Parents_Btn.addEventListener(MouseEvent.ROLL_OVER, ParentsRollOver);

               

               

              function DistrictRollOver(event:MouseEvent):void

              {

              var DistrictMenuTween:Tween = new Tween(Menu_Cont.District_Menu, "y", Regular.easeOut, Menu_Cont.District_Menu.y, 45, .5, true);

              Menu_Cont.District_Rect.addEventListener(Event.ENTER_FRAME, checkDistrictRectIfRollOut);

              }

               

              function SchoolBoardRollOver(event:MouseEvent):void

              {

              var SchoolBoardMenuTween:Tween = new Tween(Menu_Cont.School_Board_Menu, "y", Regular.easeOut, Menu_Cont.School_Board_Menu.y, 45, .5, true);

              Menu_Cont.School_Board_Rect.addEventListener(Event.ENTER_FRAME, checkSchoolboardRectIfRollOut);

              }

               

              function ParentsRollOver(event:MouseEvent):void

              {

              var ParentsMenuTween:Tween = new Tween(Menu_Cont.Parents_Menu, "y", Regular.easeOut, Menu_Cont.Parents_Menu.y, 45, .5, true);

              Menu_Cont.Parents_Rect.addEventListener(Event.ENTER_FRAME, checkParentsIfRollOut);

              }

               

              function checkDistrictRectIfRollOut(oEvent:Event):void

              {

                 var mcRect:MovieClip = Menu_Cont.District_Rect;

                 if(mcRect.mouseX > mcRect.width ||

                 mcRect.mouseX < 0 ||

                 mcRect.mouseY < 0 ||

                 mcRect.mouseY > mcRect.height)

                 {

                     mcRect.removeEventListener(Event.ENTER_FRAME, checkDistrictRectIfRollOut);

                 MenuMouseOut(mcRect);

                 }

              }

               

              function checkSchoolboardRectIfRollOut(oEvent:Event):void

              {

                 var mcRect:MovieClip = Menu_Cont.School_Board_Rect;

                 if(mcRect.mouseX > mcRect.width ||

                 mcRect.mouseX < 0 ||

                 mcRect.mouseY < 0 ||

                 mcRect.mouseY > mcRect.height)

                 {

                     mcRect.removeEventListener(Event.ENTER_FRAME, checkSchoolboardRectIfRollOut);

                 MenuMouseOut(mcRect);

                 }

              }

               

              function checkParentsIfRollOut(oEvent:Event):void

              {

                 var mcRect:MovieClip = Menu_Cont.Parents_Rect;

                 if(mcRect.mouseX > mcRect.width ||

                 mcRect.mouseX < 0 ||

                 mcRect.mouseY < 0 ||

                 mcRect.mouseY > mcRect.height)

                 {

                     mcRect.removeEventListener(Event.ENTER_FRAME, checkParentsIfRollOut);

                 MenuMouseOut(mcRect);

                 }

              }

               

              function MenuMouseOut(mcRect:MovieClip):void

              {

                  var mcMenu:MovieClip;

                  if(mcRect == Menu_Cont.District_Rect) mcMenu = Menu_Cont.District_Menu;

                  else if(mcRect == Menu_Cont.School_Board_Rect) mcMenu = Menu_Cont.School_Board_Menu;

                  else mcMenu = Menu_Cont.Parents_Menu;

                  var cTween:Tween = new Tween(mcMenu, "y", Regular.easeOut, mcMenu.y, -62, .5, true);

              }