00:00
00:00
Newgrounds Background Image Theme

dreamygf just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS: .txt File Incorporation

1,299 Views | 5 Replies
New Topic Respond to this Topic

AS: .txt File Incorporation 2006-07-26 14:22:55


AS : Main

This started when my dad asked me to do a little flash for the site. Now, you can't edit a .swf file directly; you'd have to go to the .fla file and recompile it every time you want to edit it. My dad would want to edit some of the text that's inside of it. So I googled a little, and stumbled upon a tutorial from Adobe.com

I didn't understand it at all.

After a few hours of frustration, I finally understood my problem. This tutorial is to be used for easy updating of a flash file.

~~~~~~~~~~~~

Make a new .fla file called "ext-txt.fla." In that .fla file, make two layers. Call one "actions" and the other "dyna-txt." In the actions layer, make a keyframe with these actions in it:

loadVariables ("myTxt.txt", "/");
stop();

In the dyna-text layer, make a keyframe with a dynamic textbox. Here's where the important steps come in. In the bottem, right-hand corner, there is a textbox with the word "Var:" before it. Type in "my_var"

Open up notepad. Make a text file that has absolutely anything you want on it. AT THE BEGINING OF THE TEXT FILE, put "my_var=" and save the file as "myTxt.txt" IN THE SAME FOLDER AS THE FINAL SWF FILE WILL BE IN.

Now, open the fla and export the flash file into the same folder as the text file. Open the flash file, and the dynamic textbox should have the same thing that your "myTxt.txt" has.

~~~~~~~~~~~~~

Why is this useful?

Well, in my expirience as a web designer, you get hired to make something that the employer doesn't understand: a website. There are many people who do not know any code whatsoever.

The reason for this tutorial is to make it easier for people, like future employers, to edit .swf information with a simple .txt file.

Please, give feedback on this tutorial. Thank you.

Response to AS: .txt File Incorporation 2006-07-26 14:26:09


Or you can just not delete the original .fla

Response to AS: .txt File Incorporation 2006-07-26 14:34:00


At 7/26/06 02:26 PM, Dusty_Gorilla wrote: Or you can just not delete the original .fla

Easier to modify a .txt doc then it is to modify a .fla

Response to AS: .txt File Incorporation 2006-07-26 14:34:14


At 7/26/06 02:26 PM, Dusty_Gorilla wrote: Or you can just not delete the original .fla

Yeh, but if you do it with .txt files you don't have to export every time. Which is good.
It still seems abit compliicated to just get around exporting, lol.

Good Tut though:)

BBS Signature

Response to AS: .txt File Incorporation 2006-07-26 14:37:02


Another way to do it.

var lvText:LoadVars = new LoadVars();
lvText.onData = function(data):Void {
dynamicTextBox.text = data;
};
lvText.load("textFile.txt");


BBS Signature

Response to AS: .txt File Incorporation 2006-07-26 15:16:31


Easy to understand tutorial, but kind of already done :).

http://www.newground../topic.php?id=298829


Hi there!

BBS Signature