Flash:Loading Variables from files into Flash

Posted: August 3, 2008 in Flash
Tags: , ,

Instead of re-inventing the wheel this is the document I used to get data for my flash variables

http://www.smartwebby.com/flash/external_data.asp

Basically using the “loadvariables” command you can read any file containing properly formated text, and just match up the variable with the variable in the text file, for example

loadVariables("http://192.168.0.101/data.txt",this);

The File ‘data.txt’ contains

name=1

If using more than one variable use the & (Ampersign) for example

name=1&address=somewhere&city=Kissimmee&state=FL

Presto…

Since my main database is SQL, I would have liked to read that data directly but unless you use Coldfussion and other goodies you not able to get data directly, but what you can do is have a backend page such as PHP,ASP or something else which does the query for you.

Advertisements
Comments
  1. […] Flash:Loading Variables from files into FlashInstead of re-inventing the wheel this is the document I used to get data for my flash variables http://www.smartwebby.com/flash/external_data.asp Basically using the “loadvariables” command you can read any file containing properly … […]

  2. lgarcia4617 says:

    BTW, you may bang you head if for some reason you can only generate Flash scripts in Firefox and not IE. The reason being the IE caches everything. So when you send the same loadvars command twice it wont load the second time in ie!.

    Once you bring it down the Cache in IE minimum like 8mb it works fine! Sorry there is no way to disable it

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s