title: Starling mouseover detection
body: <p>I'm making a point &amp; click game where is clickable objects. When player moves mouse over the object, there appear a tooltip beside the cursor. It works almost as intended with the code below:</p>
  
  <pre><code> private  function added():void
          {
              removeEventListener(Event.ADDED, added);
              this.addEventListener(TouchEvent.TOUCH, onTouch);
          }
  
  protected function onTouch(e:TouchEvent):void
          {
              var touchHover:Touch = e.getTouch(this, TouchPhase.HOVER);
  
              if (touchHover)
              {
                  trace("show");
                  //mouse is hovered over this object. Therefore call Hovertext:
                  if (Game.hoverText.message != name_)
                      Game.hoverText.message = name_
              }
              else
              {
                  //mouse leaves the object
                  trace("hide");
                  Game.hoverText.hideMessage(name_);
              }
  
          }
  </code></pre>
  
  <p>However, it has a strange problem I don't understand. If I move mouse over object and then move it downwards still staying over the object, it triggers hiding function in every second frame or so. Same thing happens when I move cursor to the right, but not when moving it up or left. </p>
  
  <p>So my question is what is wrong with my code? Is this even the best way to go to detect when mouse rolls over object and when it rolls away?</p>
  
  <p>EDIT: I have been going through following iterations with each of them the same problem:</p>
  
  <pre><code>var touch:Touch = event.getTouch(this);
  
          if (touch == null) {
              // Set Object alpha to 0;
              //trace("pois");
              Game.hoverText.hideMessage(name_);
          }
          else if (touch.phase == TouchPhase.HOVER) {
              // Set Object alpha to 1;
              //trace("paalla");
              if (Game.hoverText.message != name_)
                  Game.hoverText.message = name_;
          }
          else {
              // for a phase BEGIN/MOVE/STATIONARY case
              // see if the touch is over the bounds of the tile (assuming 'this' is the tile)
              HELPER_POINT.x = touch.globalX;
              HELPER_POINT.y = touch.globalY;
              this.globalToLocal(HELPER_POINT, HELPER_POINT);
              if(this.hitTest(HELPER_POINT, true) != null)
              {
                  // Set Object alpha to 1; over tile
                  trace("paalla");
              }
              else
              {
                  // Set Object alpha to 0; not over tile
                  trace("pois");
              }
  </code></pre>
  
  <h2>            }</h2>
  
  <pre><code>var touchHover:Touch = e.getTouch(this);
  
          if (touchHover &amp;&amp; touchHover.phase == TouchPhase.HOVER)
          {
              trace("show");
              //mouse is hovered over this object. Therefore call Hovertext:
              if (Game.hoverText.message != name_)
                  Game.hoverText.message = name_
          }
  
          if (touchHover == null)
          {
              //mouse leaves the object
              trace("hide");
              Game.hoverText.hideMessage(name_);
          }
  </code></pre>
  
  <p>Also here is swf for demonstating the problem:
  <a href="http://www.students.tut.fi/~salmi26/ScorpionBox.html" rel="nofollow">http://www.students.tut.fi/~salmi26/ScorpionBox.html</a></p>