Lleoun
03-11-2009, 01:33 PM
Hi all,
I have a txt file with variables equalling numbers.
In the first frame in the Action Layer of my main movie clip I have
function updateResuls()
{
loadVariables("INFO.TXT", _root);
}
System.useCodepage = true;
updateResuls();
A few frames after I have also in the Action Layer:
variable1 = _root.firstvariable;
INFO.txt contains _root.firstvariable=5
Back to my main movie clip I add a layer. In this layer I write some text and I name the "Var" field in the text properties "variable1"
This prints the 5 from the txt file when publishing the movie without problems.
Now imagine that instead of a number from the txt file I want to load a movie or a movieclip .. how should I do it??
I was working in something like:
if (_root.firstvariable==5){
variable1 = function () {
this.createEmptyMovieClip("container",1);
container._x =0;
container._y =0;
container.loadMovie("loaded.swf");
}}
In the code above:
this.createEmptyMovieClip("container",1);
container._x =0;
container._y =0;
container.loadMovie("loaded.swf");
works by its own but not the part where it is attached and equalled to variable1 ... should I create a new movie clip instead of a text field and load it inside of it?? if so, how can I do that??
NOTE: I'm using AS2
Thanks a ton in advance !!
I have a txt file with variables equalling numbers.
In the first frame in the Action Layer of my main movie clip I have
function updateResuls()
{
loadVariables("INFO.TXT", _root);
}
System.useCodepage = true;
updateResuls();
A few frames after I have also in the Action Layer:
variable1 = _root.firstvariable;
INFO.txt contains _root.firstvariable=5
Back to my main movie clip I add a layer. In this layer I write some text and I name the "Var" field in the text properties "variable1"
This prints the 5 from the txt file when publishing the movie without problems.
Now imagine that instead of a number from the txt file I want to load a movie or a movieclip .. how should I do it??
I was working in something like:
if (_root.firstvariable==5){
variable1 = function () {
this.createEmptyMovieClip("container",1);
container._x =0;
container._y =0;
container.loadMovie("loaded.swf");
}}
In the code above:
this.createEmptyMovieClip("container",1);
container._x =0;
container._y =0;
container.loadMovie("loaded.swf");
works by its own but not the part where it is attached and equalled to variable1 ... should I create a new movie clip instead of a text field and load it inside of it?? if so, how can I do that??
NOTE: I'm using AS2
Thanks a ton in advance !!