views:

32

answers:

1

I am displaying some HTML text in an Adobe AIR Application that I do not want the user to be able to cut and paste. How do I make the HTML control disallow highlighting of the HTML without disabling the ScrollBars. mouseChildren=false works but disables the scrollbars which is unacceptable. Right now I have:

        <mx:HTML location="http://dexter/preview.html" width="100%" height="100%" id="PreviewArea" x="0" y="0"  tabEnabled="false" tabChildren="false" focusEnabled="false" focusRect="null"/>

But it's not working properly either. I have also tried overlaying a disabled transparent text control over the top of the HTML component, but the user is still able to tab to the HTML and use the keyboard controls to copy the text to the clipboard.

Any hints?

A: 

You probably have to extend the HTML Component. Make the scroll bars, if applicable, usable, but apply set mouseEnabled, mouseFocusEnabled, mouseChildren, and focusEnabled to false on the inner display.

Alternatively, you could wrap the HTML component in a canvas. Set the HTML Component to it's measured height and measured width. Set the HTML Component to be 'unusable' with the above properties, but make the canvas usable.

Doesn't the HTML component display renderered HTML; not HTML Text? If you're displaying HTML Text, then you can use the TextArea and set editable and selectable to false.

www.Flextras.com