Created
October 13, 2011 17:30
-
-
Save dannykopping/1284872 to your computer and use it in GitHub Desktop.
Non-scrolling Spark TextArea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dannykopping.controls | |
{ | |
import flash.events.MouseEvent; | |
import spark.components.TextArea; | |
public class NonScrollingTextArea extends TextArea | |
{ | |
public function NonScrollingTextArea() | |
{ | |
this.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler, true, 0, false); | |
} | |
private function mouseWheelHandler(event:MouseEvent):void | |
{ | |
var originalEvent:MouseEvent = event.clone() as MouseEvent; | |
event.preventDefault(); | |
event.stopPropagation(); | |
event.stopImmediatePropagation(); | |
this.dispatchEvent(originalEvent); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment