1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Using Variables from an External Source with Flash's loadVariables()

By

There's one more thing that needs to be done before you can save the file and close it. When Flash loads the variables from the file, it won't recognize line breaks to tell it where one variable ends and the other begins; instead it pulls it all into one long string, and you need to use ampersands (&) to separate much as you would in a URL that passed variables:
 &typecolor=990000& 
&typetext=Now my text is loaded by variables.& 
&typestyle=Times New Roman& 
&typesize=30&

Feasibly you could string them all together as &typecolor=990000&typetext=Now my text is loaded by variables.&typestyle=Times New Roman&typesize=30, but when you've got multiple variables that gets to be a little hard on the eyes and makes editing the variable file rather difficult. The easiest way is to just put each variable on its own line and enclose it and its value inside starting and ending ampersands.

©2014 About.com. All rights reserved.