
January 29th, 2003, 12:23 PM
|
|
flash junkie
|
|
Join Date: Jan 2003
Location: CO, USA
Posts: 172
Time spent in forums: 5 m 38 sec
Reputation Power: 11
|
|
hey, you'll want to load the values from the text file. And generally when you load variables, they need to be formatted like:
&variable=value&variable2=value2...
So, if you had a text file "variables.txt" with:
&inum=image1.jpg
in your flash movie, you sould say:
PHP Code:
//it's not actually php, obviously, but i just wanted to format the code
myTextVars = new LoadVars();
myTextVars.onLoad = function(success){
if(success){
_root.createEmptyMovieClip("imageHolder1",200);
_root.imageHolder1._x=0;
_root.imageHolder1._y=100;
_root.imageHolder1.loadMovie(this.inum);
} else {
//trace error message
}
}
myTextVars.load("variables.txt");
You could also make an array of images in your text file, but there is no way to natively load in an array, you'd have to delimit your variables by something weird and then parse in flash:
&images=image1|image2|image3|image4
in flash you could just use the split method to make a flash native array. (flashImages = images.split("|"); )
hope that helps,
bret
|