Flex/Flash: Don't show 'bar' cursor when dragging over a TextField/TextArea?
- by David Wolever
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:
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).