In my flashfile I have a textfield and a button. I want to add information for these from a textfile.
I have managed to get the flash to link in the text from the textfile, but now I’m stuck.
I want the button to pick up the url that it should lead to from the same textfile. Unfortunately I’m more of a designer than a programmer so I am have a problem with this.
This is how you link an URL from the button:
on (release) (
getURL("");
)
Now I want to pick up the url from the textfile (info.txt).
This is what I guess that the textfile must contain, but I’m not sure:
&link=gohere.htm
OK… since you obviously are so great at this…
Might I ask you for help once more…
…else I will be struggling with this for a few more hours I guess
Say no if I’m taking up too much of your time.
I want to have an image on the page as well, and I want to get the url for the image from the same textfile.
I have created an imageholder that looks like this:
Remove the quotes…
[AS]container.loadMovie(image_lv.image);[/AS]
Also, you don’t need to load the same file twice! And it would be better if you use an onLoad handler; I’d use a dynamic event event handler instead of the static event handler to assign the actions to the Button. In the end, you’d have something like this:
[AS]var info_lv = new LoadVars();
info_lv.onLoad = function(success) {
if (success) {
myButtonInstanceName.onRelease = function() {
getURL(info_lv.link);
};
createEmptyMovieClip(“container”, 1);
container._x = 10;
container._y = 40;
container.loadMovie(this.image);
} else {
// an error has occurred
}
};
info_lv.load(“info.txt”);[/AS]
=)
Problem: the code is executed before the TXT file has been loaded.
Solution: use an onLoad event handler.
[AS]var image_lv = new LoadVars();
image_lv.onLoad = function() {
createEmptyMovieClip(“container”, 1);
container.loadMovie(this.image1);
container._x = 10;
container._y = 40;
};
image_lv.load(“produkt.txt”);[/AS]