This content has been marked as final. Show 3 replies
You'll probably need to extend TextArea to get this to work and override protected function mouseWheelHandler(). TextArea does an event.stopPropagation() in its version of this function. If you override the function and simply do nothing (do NOT call super.mouseWheelHandler()), that might do the trick.
You could try this:
1) Set textArea mouseChildren="false".
2) Add an eventListener to to the TextArea for its mouse wheel event when the app loads.
3) In the listener, scroll the canvas component.
See attached code for a working example. Just be aware that if you do this, users will NOT be able to scroll the textArea at all.
Thanks for the replies. The solution to my question is this:
public class newTextArea extends TextArea
public function newTextArea()
override protected function createChildren():void
textField.mouseWheelEnabled = false;
private var scrollAnterior:Number=-1;
private var direccionScroll:Number=0;
override protected function mouseWheelHandler(event:MouseEvent):void
var dirScroll:int = event.delta <= 0 ? 1 : -1;
if (verticalScrollPosition==scrollAnterior && direccionScroll==dirScroll)
it works fine, but now i want to make the same with the canvas, but seems is not possible override mouseWheelHandler event in it. Any help or suggestion ?
Thanks in advance