PDA

View Full Version : [AS2] write txt file - locally


Nim
11-22-2009, 04:02 PM
I've got a txt file on hard drive and I'm loading some variables from there.

What I want to do is to alter the txt file from swf. Change the variables in it.

How can I achieve this?

Both txt and swf will run on user's computer.

THX

the binary
11-23-2009, 12:20 PM
as long as you dont running it on a local webserver and use a server-side script its not possible..

Nim
11-23-2009, 01:05 PM
The swf is running on user's pc through a flash player, is not running on any server!

I just have the mytext.txt and the myflash.swf in the same folder, I'm importing some variables from txt , edit them, and then I want to save them back. Thats all.

Appreciate your help.

asf8
11-23-2009, 01:19 PM
Read through this (Saving to a text file offline)...
http://www.actionscript.org/forums/showthread.php3?t=182443

Or maybe look into Shared Objects as an alternative as well.
http://www.actionscript.org/forums/showthread.php3?p=764591

Nim
11-23-2009, 01:43 PM
Is it possible or impossible to do that in as2 without 3rd party software?
What about as3?

asf8
11-23-2009, 01:46 PM
:confused: If you read the link(s) you should be able to answer that.

Nim
12-16-2009, 01:29 PM
I think i'm going local shared objects..

1. If user (or some cleaning software) deletes LSO stored data on his computer, all saves are gone forever, right? :/

2. Do LSO works on linux or mac systems?

CyanBlue
12-16-2009, 02:07 PM
Yes and Yes... :)

Nim
12-16-2009, 02:10 PM
nice, im happy about the second one :)

I want my local swf movie to get updated - to get new variables through internet.
(some pretty vital variables for the movie)

What's your opinion? Is LSO best idea?

CyanBlue
12-16-2009, 02:19 PM
Why not save it on the server if that's something that's vital??? That way, you know that you can rely on the existence of the variable whereas you can always delete the LSO locally...

Nim
12-17-2009, 09:51 AM
Every user is gonna have different variables depending on they will.
In addition I wouldn't like an internet connection to be necessary in order for the swf to run correctly

CyanBlue
12-17-2009, 03:15 PM
That's when you make your server side script to make each entries unique...
If you don't want to rely on the Internet connection, a LSO is the only way that is free... Or use a third party projector tool to save a proper text file or sort...