0
votes

As the title suggests, how can I prevent the "bar" cursor from appearing when I click-and-drag over a TextField? For example, consider this interaction:

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

I'd like to prevent the cursor changing to the "bar" in step "2".

How can I do that?

I've tried fiddling with the selectable flag:

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;
    });
}

But the "bar" cursor still appears the first time the mouse is moved over the text field (however, after it has been moved out then moved back in, it does the right thing).

1

1 Answers

1
votes

Transparent MC over the top, to fit? Shot in the dark...

Also, not sure what impact mouseEnabled / mouseChildren would have here.

Interesting!