title: hitTestObject method fal passing newar corner
body: <p>two rectangle and given instance name <code>w1</code> and <code>w2</code> then how can pass two of my rectangle very close to each other ,when i tried to pass it stuck at corner but as much i saw the are far from each other</p>
  
  <p><a href="http://forums.adobe.com/thread/1139552" rel="nofollow">http://forums.adobe.com/thread/1139552</a></p>
  
  <pre><code>addEventListener(Event.ENTER_FRAME, moveplayer);
  var left,right,up,back:Boolean;
  
  
  // both rectangles were given  instancename as w1 and w2 and drawn on stage manually
  
  
  stage.addEventListener(KeyboardEvent.KEY_DOWN ,keypress);
  stage.addEventListener(KeyboardEvent.KEY_UP ,keyup);
  //gray box movement key
  function keypress(event:KeyboardEvent  ):void
  {
  
  
            if (event.keyCode == 37)
            {
                      left = true;
  
  
            }
            else if (event.keyCode==38)
            {
                      up = true;
  
  
            }
            else if (event.keyCode==39)
            {
                      right = true;
  
  
            }
            else if (event.keyCode==40)
            {
                      back = true;
  
  
            }
  }
  
  
  
  
  function keyup(event:KeyboardEvent ):void
  {
  
  
            if (event.keyCode == 37)
            {
                      left = false;
            }
            else if (event.keyCode==38)
            {
                      up = false;
  
  
  
  
            }
            else if (event.keyCode==39)
            {
                      right = false;
  
  
            }
            else if (event.keyCode==40)
            {
                      back = false;
  
  
            }
  
  
  }
  //grey box movement
  function moveplayer(event:Event ):void
  {
  
  
  //hit test
            if (w1.hitTestObject(w2))
            {
                      trace("hit");
  
  
  //function call to repulse back
                      repulse();
            }
            else
            {
  // function call to move
                      go();
            }
  
  
  
  
  //rotation
            if (left)
            {
                      rotateit("left");
            }
            else if (right)
            {
                      rotateit("right");
            }
  
  
  
  
  
  
  
  
  
  
  
  
            function rotateit( direc:String)
            {
  
  
                      if (direc == "left")
                      {
                                w1.rotation -=  1;
                      }
                      else if (direc == "right")
                      {
                                w1.rotation +=  1;
  
  
                      }
  
  
            }
  }
  
  
  
  
  
  
  //move function
  function go()
  {
            if (up)
            {
                      var x2:Number = w1.x;
                      var y2:Number = w1.y;
                      //trace(x2,y2)
                      var speed:Number = 5;
                      w1.x +=  speed * Math.sin(w1.rotation * 2 * Math.PI / 360);
                      w1.y -=  speed * Math.cos(w1.rotation * 2 * Math.PI / 360);
  
  
            }
  }
  //repulsion function
  
  
  function repulse()
  {
  
  
  
  
            var x1:Number = w1.x;
            var y1:Number = w1.y;
            trace(x1,y1);
            var speed:Number = 5;
            w1.x +=   -  (speed * Math.sin(w1.rotation * 2 * Math.PI / 360));
            w1.y -=   -  (speed * Math.cos(w1.rotation * 2 * Math.PI / 360));
  }
  </code></pre>