Export .txt file using ActionScript

I am runing a word macro and it creates a .txt file and then runs a .swf file. the .swf file loads the text file and based on its content it performs diferent functions. For example if the word exit is in the text file then flash will not display a movie clip for example.
How could I create a .txt file using ActionScript or save a var as text so that my word macro can then search for that .txt file and depending on what words that file has then thats what word will execute. I have the following code to load the textfile into flash:
var req:URLRequest = new URLRequest("external.txt");
var loader:URLLoader = new URLLoader();
function fileLoaded(event:Event):void
		external_txt.text = loader.data;
		external_txt.appendText(" Here's some additional text!");
loader.addEventListener(Event.COMPLETE, fileLoaded);

Open in new window

Who is Participating?
section25Connect With a Mentor Commented:
Actionscript won't let you write anything to the hard drive. That would be a serious breech of security. If it did, then people would be writing apps that screw up other people's PCs left and right.

TonoNamAuthor Commented:
Is there a way to comunicate with vba though? Could I run a flash application that will make a macro run?
I don't have any expierience with vba, so maybe someone else could answer that better than me, but I seriously doubt Actionscript could execute anything with a call to a vba script.
You could consider using ActionScript in Adobe Flex + AIR. That runs on the desktop as a standalone app and can create/edit files on the system.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.