PDA

View Full Version : Trying to understand Variables


brainmetz
07-01-2002, 07:36 PM
Is it possible to send Flash a variable from a HTML Page? Here is what I
want to do...I have a site with buttons already designed...I have a flash
file that inputs a text file to display...This is implemented into my
page...I want each button on the website to be able to interact with the
flash file to tell it which .txt file to display...This way if someone is
viewing my website...and they click news it will display the news for the
day...Or if they want to contact me, they click contact and poof my contact
info is loaded into the flash file...I know I could just use different flash
files for each of the buttons, but that seems like it could take forever to
download over a modem...That is why I wanted to dynamically update the flash
file...The text files are small and should load alot faster than an
individual page...Is this possible? Am I crazy for this idea? How would I
accomplish such a task? Or is there a way to send such a variable from one
flash movie to another?

Any suggestions would be appriciated.

Thanks,

Shane Metzler
Tingley Systems, Inc

Abelius
07-01-2002, 09:05 PM
any variables can vbe read by Flash, from HTML pages, from databases and from server-side scripts...

The keywords Flash uses to read variables is loadVariables or loadVariablesNum. As usually, the passed parameters, or arguments have to come in pairs of name & value...

tracer_bullet
07-03-2002, 07:04 AM
ok, so you want to read a .txt in Flash.
No big deal.

-First make a text area in "dynamic"mode. in "variable" give a name like "news".
-Then make your .txt files. If y'ouve got many message in it, put
&news=blablablalbal
&news2=blablablabla&news3=blablblalblalb
and so on.
If you've got only one informatoin in your files, don't put any variable name, juste the message.
-Thirdly, to read the file you've got to write this code:
loadVariablesNum("name_of_the_file_.txt","0");
it will appear in the text area (beware of the colour of the text/background).
-You can call this code on a button ( with on(press))or a frame (just the code).


If it's a form, call loadVariablesNum("files.php","0", "post").
file.php can be a ."asp" file and post can be "get"

Have fun !