代码之家  ›  专栏  ›  技术社区  ›  Aaron

相当于AS2中的Event.MOUSE_LEAVE

  •  0
  • Aaron  · 技术社区  · 16 年前

    stage.addEventListener(Event.MOUSE_LEAVE, callbackFunc);
    
    private function callbackFunc(e:Event):void {
        // do something
    }
    
    3 回复  |  直到 16 年前
        1
  •  2
  •   Ian Smith    15 年前

    我为此挣扎了一段时间,最后在flashhtml对象上使用JavaScript事件监听器,然后将其绑定到Flash的外部接口,以设置鼠标移动和移出事件发生时的标志。这似乎工作完美,没有任何错误。

        2
  •  1
  •   jml    16 年前

    一开始我以为这只是一次展示-

    stage.onRollOut = function(){
        //the action could occur here
    }
    

    这似乎工作不正常。。。但话说回来;您可以将阶段定义为MovieClip()。

        3
  •  1
  •   can3p    14 年前

    如果鼠标不在剪辑中,可以检查xmouse属性以查看

    _root.onMouseMove = function()
    {
        if(
           _xmouse <= 0 || 
           _ymouse <= 0 ||
           _xmouse >= Stage.width - 1 ||
           _ymouse >= Stage.height - 1
        )
         outCallBack();
    }
    
    function outCallback()
    {
       bla;
    }
    
    推荐文章