0

我试图禁用鼠标单击并从 UIComponent 外部呈现繁忙的光标。我这样做:

protected function setBusyCursor() : void {

        const stage:Stage = mx.core.FlexGlobals.topLevelApplication.stage;
        if (stage){
            stage.mouseChildren = false;
        }
        CursorManager.setBusyCursor();
    }

这确实禁用了鼠标单击,但出现的光标是常规指针(不是忙碌的指针)。知道我做错了什么吗?

4

2 回答 2

0

所需的所有代码,我测试了 4.5.1 flex 框架,工作完美。采用:

protected function setBusyCursor() : void 
{       
    FlexGlobals.topLevelApplication.mouseChildren = false;
    CursorManager.removeAllCursors();
    CursorManager.setBusyCursor();
}
于 2013-03-06T15:17:29.063 回答
0

最后我设法做到这一点:

protected function setBusyCursor() : void 
    {   
        var i : int = 0;
        var uiComponent : UIComponent = FlexGlobals.topLevelApplication.parent.getChildAt(i);
        while (uiComponent != null){
            uiComponent.mouseChildren = false;
            uiComponent.cursorManager.setBusyCursor();
            i+=1;
            if ( FlexGlobals.topLevelApplication.parent.getChildAt(i) is UIComponent) {
                uiComponent = FlexGlobals.topLevelApplication.parent.getChildAt(i);
            }
            else {
                uiComponent = null;
            }
        }
    }

    protected function removeBusyCursor() : void {
        var i : int = 0;
        var uiComponent : UIComponent = FlexGlobals.topLevelApplication.parent.getChildAt(i);           
        while (uiComponent != null){
            uiComponent.cursorManager.removeBusyCursor();
            uiComponent.mouseChildren = true;
            i+=1;
            if ( FlexGlobals.topLevelApplication.parent.getChildAt(i) is UIComponent) {
                uiComponent = FlexGlobals.topLevelApplication.parent.getChildAt(i);
            }
            else {
                uiComponent = null;
            }
        }

    }

它禁用屏幕上的所有鼠标点击并放置忙碌光标。

于 2013-03-14T17:30:11.283 回答