Solved

How to write a text file with Actionscript

Posted on 2006-06-13
4
718 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
Comment Utility
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:Dushan911
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now