如何在更改/编辑文本区域时自动在flex中保存文本文件。请帮我

时间:2022-11-23 05:26:25

I had a situation like.... I need to save a text area field in the form of .text file automatically when ever the text area is changed/edited. Please some one help me.

我有一种情况......我需要在更改/编辑文本区域时自动以.text文件的形式保存文本区域字段。请有人帮助我。

Thanks in advance

提前致谢

1 个解决方案

#1


1  

In a Flex TextInput or TextArea you can use the change event to detect when something has changed. So, you'll probably want to use that to trigger your "save this text" code.

在Flex TextInput或TextArea中,您可以使用change事件来检测何时发生了更改。因此,您可能希望使用它来触发“保存此文本”代码。

If you want to save things as a file on the server, then you can use that change event to trigger your service.

如果要将内容保存为服务器上的文件,则可以使用该更改事件来触发服务。

If you want to save things on the client machine, you may have more difficulty.

如果要在客户端计算机上保存内容,可能会遇到更多困难。

If you're dealing with an AIR application, you can save the file locally using the File class.

如果您正在处理AIR应用程序,则可以使用File类在本地保存文件。

In a browser based app; you cannot save files without user input. So the location, and filename of the file is beyond your control. Accessing that file at some future point also requires user input.

在基于浏览器的应用程序中没有用户输入你无法保存文件。因此,文件的位置和文件名超出了您的控制范围。在将来某个时候访问该文件也需要用户输入。

You may be able to store the value as a shared object, which is in essence the Flex version of a cookie.

您可以将值存储为共享对象,这实际上是Cookie的Flex版本。

#1


1  

In a Flex TextInput or TextArea you can use the change event to detect when something has changed. So, you'll probably want to use that to trigger your "save this text" code.

在Flex TextInput或TextArea中,您可以使用change事件来检测何时发生了更改。因此,您可能希望使用它来触发“保存此文本”代码。

If you want to save things as a file on the server, then you can use that change event to trigger your service.

如果要将内容保存为服务器上的文件,则可以使用该更改事件来触发服务。

If you want to save things on the client machine, you may have more difficulty.

如果要在客户端计算机上保存内容,可能会遇到更多困难。

If you're dealing with an AIR application, you can save the file locally using the File class.

如果您正在处理AIR应用程序,则可以使用File类在本地保存文件。

In a browser based app; you cannot save files without user input. So the location, and filename of the file is beyond your control. Accessing that file at some future point also requires user input.

在基于浏览器的应用程序中没有用户输入你无法保存文件。因此,文件的位置和文件名超出了您的控制范围。在将来某个时候访问该文件也需要用户输入。

You may be able to store the value as a shared object, which is in essence the Flex version of a cookie.

您可以将值存储为共享对象,这实际上是Cookie的Flex版本。