Written by: BAHRAMI
Time: 15 minutes
Difficulty Level: Beginner
Requirements: Flash 4 or 5. DOWNLOAD FLA

Fill in the text boxes and press the go button

Variables are used to hold data (information).

"A variable is simply a container, a bucket if you will. However this bucket can only contain one piece of information at any one time, no matter how small or big." Derek Franklin, Author of Flash 4!

I think that the best way to get a grip of variables is to start playing with them. This tutorial is on a newbie level and shows the basics of dealing with variables. A great start if you ask me.

Step 1 - First of all make two graphic symbols and draw your characters on the first frame on each one of them. In this case I drew a girl in "symbol 1" and a boy in "symbol 2"

Step 2 - Go to your main timeline, add a keyframe at frame one and make four input text boxes using the "text options panel" (ctrl+T) or window>panels>text options. Give all the boxes a variables name. In this case:

box1 = nameboy
box2 = namegirl
box3 = dialogue1
box4 = dialogue2
Step 3 - Asign a stop action to this frame, and the last thing to do on frame 1 is to add a button with this action asigned to it.

on (release) {
gotoAndPlay (2);
}

Step 4 - Go to frame two, make a dynamic text box ("ctrl+T" or window>panels>text options) and give it a variable name (in this case "balloon"). Add this action to the frame.



frame1 ---- stop();
frame2 ---- balloon = "hi ! " add nameboy add " how do you do today? ";
frame10--- balloon = "thank you "add namegirl add " ";
frame20--- balloon = dialogue1;
frame30--- balloon = dialogue2;
frame40--- stop ();

A final note -What you have done now is that you simply stored information in a input textbox (step2), and then revealed that data with the help of a dynamic text box in (step 4). Add some necessary graphics and now you have done the first dialogue. It's very easy. Download the FLA and see how you with minimal scripting can create a nice graphic-conversation that the user totally controlls.