PDA

Click to See Complete Forum and Search --> : Writting to a text file



David Jones
08-10-2000, 03:37 PM
Can I write to a text file from a SWF or a Projector? If so could you please point me in the right direction.

Thanks
David

The Master
08-15-2000, 03:14 PM
This applications claims to be able to do just that..
http://www.ashzfall.com/products/afsaver

And the tests appear to work for the demo..

Pope de Flash
08-15-2000, 03:53 PM
Didnt take you long to adopt that one :) Regards, Bill

David Jones
08-15-2000, 03:59 PM
I know this is not the appropriate place to post this but I downloaded the AFSaver program and I have a couple of questions:

1. It will write the file up to the point it reaches a space in a variable value and then it stops writing. Is this the way it is suppose to working or am I doing something wrong.

2. Can the file name that is written be a variable?

If anyone is familiar with this or if you can direct me to a appropriate forum I would appreciate it.

Thanks
David Jones

The Master
08-15-2000, 06:49 PM
This is the most appropriate forum I know of David.. your 2nd best bet would be the newsgroups devoted to flash.. (that should be under the support section at macromedia)

The question I have concerning your problem is what kind of space?

A space in flash or a space in the executable?

As I forewarned I have no knowledge of this program beyond the demo.. if you understand the basics of being a webmaster then perhaps you could take some screenshots to better demonstrate the problem..

If your not familuar with screen shots you hit the Print Screen key or Alt + Print Screen (just for windows) to send a screen shot to the clipboad then you paste it into a image application..

Again this hole proccess is just if your familuar with the art of webmastery :)

Pope de Flash
08-15-2000, 10:59 PM
I have had some problems with the product and support seems not to be a real concern for the company. I tried to contact the guy seven months ago and had no luck with any answers. I'm not a programer nor the son of a programer, so I have deep appreciation for those who do program like TM. I have not had any luck getting the text to save with spaces in it. It could be my limited understanding of programing but I think its more the limitation on the program. If you look at the help file on the strange ugly site, it tells you how to replace the spaces with a "|". Hey I didnt get it but maybe you guys can. Let me know if you figure it out. First one who can save a real text field to the hard drive gets my $20 Bucks, I want to do all my CBT work right in Flash. I hate lingo. yuck!! Any way enough of my rant and I hope that helps out. Regards, Bill

The Master
08-16-2000, 12:48 AM
Well I don't see the problem actually if it's a space in the name of the saved variable then that was pretty easy and it worked with the demo..

Note: I did not add the bars to the code in the screenshot the program did that for me.. I just placed spaces in the textbox..

Maybe this screen shot will demonstrate, If you really need a utility for writing text files Pope I can investigate making you a program for that.. I'm sure it's way simple..

Now that I actually look at the program this guy has made his method to me becomes obvious either he
A. Worked with the source code available from macromedia.com to compile a program that makes special executables
B. Wrote a patch or hex edit modifying the entire executable which looks for certain strings and replaces them with modified strings..

http://www.windowshelp.net/afsaver.gif
[Edited by The Master on 08-16-2000 at 12:50 AM]

David Jones
08-16-2000, 10:36 AM
OK, I have downloaded the 2.0 version and enter the FS Command exactly as the documentation states and it still does not save past the space without manually putting in the pipes. The Flash demo that comes with the exe works but not my project. Do I to use Flash to convert the spaces to pipes or does the exe. If it is done in Flash how do I detect spaces and convert them to pipes.

Is all of this going to be handled from within Flash 5?

Thanks for the help!

David Jones

David Jones
08-16-2000, 11:36 AM
Just in case anyone is interested this is what I came up with to replace the spaces with pipes.

On (Release)
Set Variable: "LoopIndex" = Length (Name)
Trace ("String Length ="&LoopIndex)
Set Variable: "Index" = "1"
Loop While (Index <= LoopIndex)
Set Variable: "TheChar" = Substring ( Name, index, 1)
Trace ("TheChar ="&TheChar)
If (Ord (TheChar) = 32)
Set Variable: "TheChar" = "|"
Set Variable: "Name" = Substring ( Name, 1, index-1 )&TheChar&Substring ( Name, index+1, Loopindex )
Trace ("Name ="&Name)
End If
Set Variable: "Index" = Index + 1
End Loop
End On


It seems to work fine. Name is the variable assigned to a entry field.

Later,
David

Flatcrap
08-20-2000, 02:33 AM
Yo Pope,

We met at FF2K in San Fran. The guy in the Coast Guard.

Anyhow, I've been using SwiffTools SwiffCanvas to create projectors and read/write textfiles. It all works very well once you get around the funky pathing to the registry. It writes Georgeous text files:) However, all relative Load Variable/Load Movie calls try to retrieve from a system or temp directory. Once you work around that, It's simple and very elegant.

If your interested I could put together a tutorial or two on making Load Movie and Load Variable from a relative path work in Swiff Canvas.

Steve
http://www.flashcraft.com

The Master
08-20-2000, 03:30 AM
I in truth I could never understand why anyone would want to generate a variable in flash for a standalone.. that's why I never ever thought to add such features to my command line program.. (and it still doesn't seem to be a viable feature)

But I think you should have a look at this thread it might help..

http://www.flashkit.com/board/showthread.php?threadid=16998

Flatcrap
08-20-2000, 12:54 PM
Originally posted by The Master
I in truth I could never understand why anyone would want to generate a variable in flash for a standalone..

I have found plenty of uses for storing and recalling variables in a standalone.

Example 1: A standalone Jeopardy type trivia game, that allows user/facilitators to enter their questions in one part of the movie that writes them to a text file. Later, when they open the movie to use it in a game, they can recall the questions for load into the game.

Example 2: For tracking progress, scores, time of completion, completion of computer based instruction.

Those are the two biggies I use it for. True, you can load variables from a local text file with a normal projector. But you need a third party application to write variables to a text file. I have tried AFSaver, FlashTools Writer, Command Line writing, ***********, and Swifftools Canvas. And though it is the most expensive at $100 Swifftools Canvas has done the best job for me.

Steve
http://www.flashcraft.com

dangercorp
08-20-2000, 01:27 PM
Afsaver?...support...? don't say those two in the same breath.

I have this love hate relationship with Afsaver..I love it because it has alot of potential, but I hate it because the examples suck, the product docs suck, and the interface to see the examples is pitiful.

However...the dang thing works pretty good for saving a file, I'll have to admit.

Anyway I worked with it for a long time and creating the strings was a ***** for multiple variables. After I figured out the FS Command syntax and wrote the pipe script manageing to get the strings correct for saving 30 variable was chore. So I wrote a front end for Afsaver 2.0 to do it for you. I just did the Save command because that's All I needed, but I might add a few more.

Anyway...it will certainly help anyone that uses afsaver to save to a text file some serious time. putting the FS strings together. And flash Guru's already provided ou with a parsing script for the pipes so your good as gold.

It's online, and if you want the exe...I'll send it to you...I havent stuck a download link on there yet...I will soon.