Flex / Flash:在TextField / TextArea上拖动时不显示“bar”光标?

时间:2010-06-01 15:51:11

标签: flex flash textfield

正如标题所示,当我点击并拖动TextField时,如何阻止“条形”光标出现?例如,考虑这种互动:

alt text http://img.skitch.com/20100601-dhsqsgfsjphfdf3eambshww72m.png

我想在步骤“2”中阻止光标变为“bar”。

我该怎么做?

我试过摆弄selectable旗帜:

protected static function fixMouseOverAfordance(field:TextField):void {
    var iOwnClick:Boolean = false;

    function handleMouseOver(event:MouseEvent):void {
        if (event.buttonDown) {
            field.selectable = iOwnClick;
        } else {
            field.selectable = true;
            iOwnClick = false;
        }
    }

    field.addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver,
                              false, EventPriority.CURSOR_MANAGEMENT+1);
    field.addEventListener(MouseEvent.ROLL_OVER, handleMouseOver,
                              false, EventPriority.CURSOR_MANAGEMENT+1);
    field.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseOver,
                              false, EventPriority.CURSOR_MANAGEMENT+1);

    field.addEventListener(MouseEvent.MOUSE_DOWN,
        function(event:MouseEvent):void {
            iOwnClick = true;
            field.selectable = true;
    });
}

但是当鼠标第一次移动到文本字段上时,“条形”光标仍会出现(但是,在移出它然后移回后,它会做正确的事情)。

1 个答案:

答案 0 :(得分:1)

透明MC顶部,适合?在黑暗中拍摄......

另外,不确定mouseEnabled / mouseChildren会对此产生什么影响。

有趣!