Solved

How to write a text file with Actionscript

Posted on 2006-06-13
4
733 Views
Last Modified: 2010-07-27
I need to know how to write a text file using Actionscript without using a server.  This swf will run from a cd and must be able to write to the user's computer.
0
Comment
Question by:noir20754
4 Comments
 
LVL 37

Expert Comment

by:CyanBlue
ID: 16899001
Howdy...

You cannot do that with the SWF...  You will need to use third party projector tools such as Zinc or SWF Studio to create EXE file and then use that to create a text file...

CyanBlue
0
 
LVL 17

Expert Comment

by:Dushan De Silva
ID: 16899235
Sometimes this will not a efficient way.
Using getURL command call a external DOS BAT file with passing parameters to it.
eg: getURL("script1.bat parameter1 parameter2 parameter3)

Inside BAT file use $1, $2, $3 for capture parameter1, parameter2, parameter3 values.
Then inside bat file to write to external text file you can use

echo $1 "is parameter1" > textfile.txt
 echo $2 "is parameter2" >> textfile.txt
echo $3 "is parameter3" >> textfile.txt

likewise you can write.
If you want you can replace this BAT file with VB generated exe or some other language generated exe file.

BR Dushan
0
 

Author Comment

by:noir20754
ID: 16899701
Dushan911, I have tried your method and it seems like it should work, however there are two problems.  As typed, I cannot figure where you intend to close string and none of my guesses have been correct; please type the getURL command exactly.  Second, when I run it without sending any arguments, a box pops up asking me whether I wish to let the file run.  This is merely WIndows virus protection, but would be annoying and confusing to my end users.  Is there a way to avoid this (perhaps  by using fscommand)?
0
 
LVL 7

Accepted Solution

by:
Ramy_atef earned 500 total points
ID: 16901994
Hi
You better use sharedObjects, it's so simple
I've made you a FLA file , download it from:

www.pylon-group.com/temp/sharedObjects.fla

write what u want in the text box then click on Save, then click on clear ( or even close the file then run it again ) , when u click on Load, it'll load what you wrote again

Rebards,
Ramy
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question