sharmacal
sharmacal

Reputation: 457

disabling scroll on textarea

I have a textarea with some content and links.

When i use this

textarea.mx_internal::getTextField().mouseEnabled = false;
textarea.mx_internal::getTextField().mouseWheelEnabled = false; 

the scroll is disabled, that is what i want to achieve.

But the texarea also has some html links, they also become not clickable.

How can I achieve a situation where the textarea has active links working properly on mouseclick, but the textarea should not be scrollable by the mouse wheel.

The issue shows up in mac only, not in windows. Thanks

Upvotes: 0

Views: 1111

Answers (1)

sharmacal
sharmacal

Reputation: 457

I got the solution for my case. Here it is.

  textarea.mx_internal::getTextField().enabled=true;
    textarea.mx_internal::getTextField().mouseWheelEnabled = false;  

    textarea.addEventListener(MouseEvent.MOUSE_WHEEL,
    function(event:MouseEvent):void{callLater(setScroll,new Array(textarea));});

    function setScroll(field:TextArea):void{
        field.verticalScrollPosition = 0;
    }

Upvotes: 2

Related Questions