5 Replies Latest reply on Dec 14, 2010 2:49 PM by kglad

    help with 2.0 hitTest

    3.0Ronin

      Hello and good morning.


      I am most familiar with actionscript 3.0, so my 2.0 is definitely rusty.


      What I am trying to do is this: on a roll over nothing happens at first. The clip starts revealed, and an initial roll over does not change anything. However, on a roll out, the clip moves down 181 pixels.


      Now that it is in the down state, subsequent roll overs will tween it back to a _y of 0 (so moving back up). Thereafter the roll off and roll overs will function normally (so only that initial roll over has no effect, because the clip will already be at _y: 181).


      This clip has a lot of embedded functionality, so much so that I cannot use rollOver or rollOut. It buttonmodes the whole thing and disallows the mroe delicate functions. So I have to turn to hitTest, and am hitting a wall with what it can allow me, especially with how you'd record the rollOut equivalent in a hitTest environment. Here is the code I am trying to work with.


      this.onEnterFrame = function(){
          if(hitTest(_root._xmouse, _root._ymouse, true)) {
              if(bookingMask._y == 181){
                  var yUp:Tween = new Tween(bookingMask, "_y", Regular.easeOut, 181, 0, 2, true);
              }
              if(bookingMask._y == 0){
                  //trace("up and over");
              }
             
          }
      }


      So, essentially it needs to move down 181 pixels when the hitTest is false (mouse not in the area) and back up to _y:0 when the hitTest is true. As someone not as versed in 2.0 as I need to be, can any of you see fit to help a poor developer out? I'd really appreciate it. I feel the answer is something simple that I am missing.


      thanks!


      -ronin