保存变量值到一个现有的.txt文件使用ActionScript 3 [英] Save a variables value into a existing .txt file with actionscript 3

查看:268
本文介绍了保存变量值到一个现有的.txt文件使用ActionScript 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个变量的值保存到一个现有的.txt文件。我已经以某种方式固定的,但而不是将其保存到一个现有的文件,它会创建一个新的.txt文件,每次...请帮我...

i want to save the value of a variable into a existing .txt file. i have fixed it in some way, but instead of save it into a existing file, it creates a new .txt file everytime... please help me...

这里是code:

var file:FileReference = new FileReference();

    var ba:ByteArray = new ByteArray();
    ba.writeUTFBytes(total);

    //save into drive
    file.save( ba, "register.txt" );

请帮帮我!

推荐答案

看的保存方法的文档:

<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html" rel="nofollow">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html

似乎没有有一种方法使用现有的文件,它可以只写入一个新文件。在其他语言中,你会打开追加模式的文件。由于闪存的运行方式,它似乎并不像,这是可能的。

There doesn't appear to be a way to use an existing file, it can only write to a new file. In other languages you would open the file in "append" mode. Due to the way Flash runs, it doesn't seem like this is possible.

如果您使用的是AIR它看起来像你可以使用<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/FileStream.html#open()"相对=nofollow> FileStream.open ,以打开<一个文件href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/FileMode.html"相对=nofollow>追加模式。

If you're using AIR it looks like you can use FileStream.open to open a file in APPEND mode.

这篇关于保存变量值到一个现有的.txt文件使用ActionScript 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆