Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]

Subject: Re: [flasher] Getting variables from a txt file
From: Marc Antony Vose
Date: Tue, 27 Mar 2001 20:17:07 -0000

>on 27/3/2001 1:57 PM, JGL at infoatdesignthenet [dot] com wrote:
>> loadVariablesNum ("./variables.txt", 0);
>> 0 is the level you wish to load the variables
>> variables.txt is in the same folder as the movie and contains:
>> var1=var1
>> &var2=var2
>> &var3=var3
>> &var4=var4
>> etc . . .
>> jgl
>Do i have to use the handler var1?
>Because at the moment the variables are at present within the movie labelled
>a1-a9. could i therefore use a1=2 etc and how can does. flash know that the
>variables are numeric values?

those are "name value pairs". it's in that format because it's the
same format in which variables are passed to cgi scripts and
dynamically scripted web pages.

the first part is the variable name, the second part is the value
associated with that variable.

if you have a1=23&a2=dog&a3=14&a4=cat the the text file loaded into flash:

a1 + a2 = "23dog";
a1 + a3 = 37;
a2 + a4 = "dogcat";

how does flash know what's a number and what's not? who cares? it
does. it's smart enough to know when to treat the contents of a
variable like a string and when to treat it like a number.

so, anyway, you don't have to use "var1" or anything. you can use
"a9" you can name a variable anything you want, as long as it starts
with a letter and only has alphanumeric characters (or underscore).


those are all valid variable names

Marc Antony Vose

When a man is generally detested,
or when he is generally beloved,
closer examination is necessary.
-- K'ung-Tzu

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]