Using Flat text Files with Flash (page 1)

Sometimes when you need to develop a small application/object like a menu bar or an intro for a client where the words may need to be changed inside or other variables controlled. Instead of them having to open up the .FLA file and manually editing the actionscript or text inside, why not create an easy to use text file? This tutorial will show you how to create this Menu Bar that uses flat text files to show menu items and urls:

Let's start with the txt file itself. I have called this data.txt:

&btn1=HOME
&btn2=TRANSLATION
&btn3=INTERPRETATION
&btn4=PROOF READING
&btn5=CONTACT
&btn6=QUOTE
&btn1URL=item1.htm
&btn2URL=item2.htm
&btn3URL=item3.htm
&btn4URL=item4.htm
&btn5URL=item5.htm
&btn6URL=item6.htm

All lines start with an "&" symbol. This simply tells Flash that the next word e.g. btn1 is a variable
The = sign means that until the next Ampersand (&) all text is part of that variable
As you can see the code is very flexible as it avoids the confusion of Speech Marks is other languages like PHP echo.
The variables can have any name and any data, as you can see we can specify any URL for btn1-6URL variable whether it be relative e.g. item1.htm, or absolute e.g. http://www.wingdude.net

The FLA itself consists of 4 layers:
- Background Layer
- Button's Layer
- Button Separators
- ActionScript

The background of the bar was made using a modified version of the excellent Nav Bar tutorial by
http://twiztedstyle.net/forums/viewtopic.php?t=236
(link not working atm)


I only used the first half of the tutorial, the separators and everything else was made in flash, these can be made by drawing a black line from top to bottom (1px) and another lighter color (#FFEDCF) (1px) next to it

Page 1 2 3 4






HOME - BLOG - TUTORIALS - PHP - CSS - FLASH - PHOTOSHOP - PROJECTS - DOWNLOADS AND APPS - CONTACT