在 Flash 中将 TextArea 设置为只读?
我是 Flash 新手,我想将 TextArea 设置为只读,以便用户无法复制和粘贴文本。
这可能吗?
欢迎示例或链接我不介意学习;)
谢谢
I am new to Flash and I have a TextArea I would like to make read-only so the user can not copy and paste the text.
Is this possible?
Examples or links welcome I dont mind learning ;)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
TextArea 有一个
editable
属性。你可以用它。然而,我很确定不可能使其完全防复制粘贴。不过,你可以让它变得困难。也许,从文本中创建图像并显示它会使文本难以被复制,但并非不可能。There is a
editable
property for the TextArea. You can use that. However, I am pretty sure it would be impossible to make it completely copy-paste proof. You can make it hard, though. Perhaps, creating a image out of the text and displaying it would make the text hard to be just copied but not impossible.您可以使用
textArea.textField.selectable
来避免复制/粘贴:在 Flex 中,
TextArea
有自己的selectable
:You may be able to use
textArea.textField.selectable
to avoid copy/paste:In Flex,
TextArea
has its ownselectable
:您所需要做的就是右键单击放置在网页上的文本区域。然后从弹出窗口中单击“编辑标签”或按“Shift + F5”。将显示文本区域的属性窗口。如果尚未选择,请单击“常规”选项。然后只需单击属性窗口中的“只读复选框”即可。您还可以通过选中“禁用复选框”来防止文本区域框的内容被选择、复制和粘贴。
我希望这能解决您的问题。
All you need do is, right click on the textarea you placed on your web page. Then from the pop-up window, click on "edit tag" OR press "Shift + F5". The property window for textarea will be dispayed. Click on the General option if not already selected. Then simply click on the "read only check box" in the property window. You can also prevent the content of textarea box from being selected, copy and paste by checking the "disabled check box".
I hope this will solve your problem.
这是我快速制作的一个类,您可能会发现它很有用:
并使用该类:
如您所见,您可以通过以下方式轻松更新文本:
Here's a class I quickly made that you might find useful:
And to use this class:
As you can see, you can easily update the text via: