views:

385

answers:

1

I have a TextArea that I don't ever want to be scrolled. When scrolling within the application that holds this TextArea, however, the scrolling stops as soon as the mouse ends up over the TextArea.

Is there any way to pass the scroll event to the application, or tell the TextArea to not claim the event?

+2  A: 

Found it. The ScrollControlBase that TextArea extends from catches the MOUSE_WHEEL event and dispatches a SCROLL event. To let the parent know that the mouse wheel was used, you have to dispatch the original mousewheel event again.

TL;DR: Add an event listener to the TextArea that catches and re-dispatches the MouseEvent.MOUSE_WHEEL event.

_textArea.addEventListener(
    MouseEvent.MOUSE_WHEEL, 
    function(e:MouseEvent):void 
    {
        dispatchEvent(e);
    }
);
I Never Finish Anythi
You should also be able to extend the textArea and override the scroll wheel handler to do the same
invertedSpear