1 Reply Latest reply on Jul 28, 2009 9:46 AM by bwclan

    need to decrease hit area via actionscript - am stuck !!

    bwclan

      Hi all i have a drop down menu am working on and each button tab (although they are not button instances !) when clicked opens up the "drop down" section which you can mouse over to choose another specific button etc - if you mouse out of that drop down area then it pulls back up to the original tab state ..  what do i change to the code below to decrease the area that you mouse out of to make the drop down area pull back .....at the moment it at least two inches on the screen below and to the right of boundaries of the drop down box before it pulls up - i want to it pull up as the mouse leaves the boundary box .... hope this makes sense .... i have spent hours trying to solve this but no luck !!   there is some part of the actionscipt below that controls this but can work out which bit and how to change it !!! (am guessing the x mouse and y mouse bits - but how to change it ???)

      many thanks ... ps i have inclu the swf - the tab i am working on is funerals.. it wouldnt let me upload the fla for some reason !

       

      function init()
      {
          for (var _loc2 = 0; _loc2 < 4; ++_loc2)
          {
              var _loc3 = dd["btn" + (_loc2 + 1)];
              _loc3.id = _loc2 + 1;
              _loc3.onRelease = function ()
              {
                  SetSimNum(this.id);
                  closeDD();
              };
              _loc3.onRollOver = function ()
              {
                  restButs(this.id);
              };
          } // end of for
          ddbtn.onRelease = function ()
          {
              if (ddOpen)
              {
                  closeDD();
              }
              else
              {
                  openDD();
              } // end else if
          };
      } // End of the function
      function openDD()
      {
          restButs(currentSim);
          this.gotoAndPlay("open");
          ddOpen = true;
          this.onEnterFrame = function ()
          {
              if (!this.hitTest(this._xmouse + this._x, this._ymouse + this._y))
              {
                  delete this.onEnterFrame;
                  closeDD();
              } // end if
          };
      } // End of the function
      function closeDD()
      {
          this.gotoAndPlay("close");
          ddOpen = false;
          delete this.onEnterFrame;
      } // End of the function

       


      stop ();
      this.numberOfSIMs = 1;
      var currentSim = 1;
      var ddOpen = false;
      init();

        • 1. Re: need to decrease hit area via actionscript - am stuck !!
          bwclan Level 1

          just to add ... as you can see in the swf - if you click on funerals the drop down opens - if the userdoesnt want to go down that menu and moves the mouse over to memorials and clicks that then the memorials drop down opens but the funerals drop down doesnt close - ideally it would be great for the drop down to open on mousover on the funerals tab and automatically close on mouse out of the funeral tab ...... damn am confused !!!

          craig