Can I read and write text file using AS3?
I want to make开发者_如何学Python a registration page with Flex. The data will be stored to text file. is it possible?
please help, thanks in advance.
Flex, in fact, it can read and write text files, but remember that is a client-side language, you can read and write but in the client, not in server, and you need Flash Player Version 10.0 or higher. If you need to write in the server, that as i see you need it, you need a server-language and use a remote object/webservice/httpservice or something like that to transfer the data that you want to store and let the server side make the text file. Another alternative is use Air, but it is desktop based, not web.
Hope this helps you a bit.
If you're using Adobe AIR, then you can read and write files on the user's machine using the File class.
If you are doing something browser based, then you can write files on the user's client machine using FileReference.save, but it will require user interaction to save the file. If you have limited data, you may be able to store it as a Shared Object. You can use File.browse to get a hook to a file. It requires user interaction, though.
If you need to store data on a server, then Flex cannot help you, but most server side software that I'm aware of should be able to create and read text files on the server. Flex will need to trigger a remote service to do so using RemoteObject, WebService, or HTTPService.
Yes, as long as the file is on a web server.
With that said, it's overkill to create only a registration page in Flex. You'd be better off using html/javascript.
精彩评论