[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 713
  • Last Modified:

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

  • 2
1 Solution
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.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now