1 Reply Latest reply on Feb 1, 2007 11:11 AM by kglad

    ifStatment question conflict

    Level 7
      I have the following ifStatment.

      function subMenuOff(theBtn:MovieClip):Void{

      if(!nav1.production_menu.digital_btn.hitTest(_xmouse, _ymouse) &&
      !nav1.production_menu.video_btn.hitTest(_xmouse, _ymouse) &&
      !nav1.production_menu.events_btn.hitTest(_xmouse, _ymouse)){
      trace("subMenuOff on the Production side");


      }

      else if(!nav1.case_menu.case1_btn.hitTest(_xmouse, _ymouse) &&
      !nav1.case_menu.case2_btn.hitTest(_xmouse, _ymouse)){
      trace("subMenuOff on the Case Studies side");


      }
      }


      Somehow the two cases of the ifStatment get triggered at the wrong time.
      Sometimes one side trigger the otherside, sometimes it does not. What
      could that be? I am probably missing something....?

      I put a trace on all the buttons that just says trace(this), and so it
      seems that the right buttons trace, but I don't get the right part of
      the if to trigger?

      You can see the file in action here:
      http://www.agilitygraphics.com/clients/capitola/
      Production Services and Case Studies menu subbuttons are what this is about.

      The traces look something like this:

      _level0.nav1.production_btn
      _level0.nav1.production_menu.events_btn
      subMenuOff on the Case Studies side
      _level0.nav1.production_menu.events_btn
      subMenuOff on the Production side
      _level0.nav1.production_btn
      _level0.nav1.production_menu.video_btn
      subMenuOff on the Production side
      _level0.nav1.case_studies_btn
      _level0.nav1.case_menu.case2_btn
      subMenuOff on the Production side
      _level0.nav1.case_menu.case2_btn
      subMenuOff on the Production side



      Thank you for the help!