How to Read an SWF Variable From an AS3
The ActionScript language functions with Flash to provide an interactive movie on your website. You use the ActionScript language to import variables set up in the movie's HTML file. These parameters set up dynamic positioning, loading and graphics settings for the animation. You load the parameters into the "param" object to retrieve the variables for the SWF file.
Instructions
-
-
1
Open the ActionScript software from the "Adobe" program group in the Windows menu. Open your SWF Web project and double-click the file you want to use to import the parameters.
-
2
Load the variables set up in the file into the parameter's object. You use this object to loop through each variable. The following code creates the variable:
var varlist:Object = LoaderInfo(this.root.loaderInfo).parameters;
-
-
3
Loop through each variable to retrieve its value. The following code loops through each value and displays them in a text box named "myvars":
for (keyStr in varlist) {
values = String(varlist[keyStr]);
myvars.appendText("\t" + keyStr + ":\t" + values + "\n");
}
-
1