Hi,
I'm kinda new in actionscript so I need your help on this. I'm trying to create a swf that gets vars (friend1;friend2;local1 and local2) from a txt file and insert it on the textboxs (instanced as box1_txt;box2_txt;local1_txt and local2_txt).
So far so good. I managed to do that with the folowing code:
myData = new LoadVars();
myData.onLoad = function(success){
if (success) {
box1_txt.htmlText = this.friend1;
box2_txt.htmlText = this.friend2;
local1_txt.htmlText = this.local1;
local2_txt.htmlText = this.local2;
}
}
else {
box1_txt.htmlText = "error loading variable";
box2_txt.htmlText = "error loading variable";
}
}
myData.load("example.txt");
But now I need to create 2 movieclips and its position (x,y) must change acording to the vars local1 and local2.
I must be doing something (completely) wrong. I tried to following code:
_root.circulo1_mc._visible = false;
if (local1_txt.htmlText == "Rome") {
circle_mc._visible = true;
circle_mc._x = 287.0;
circle_mc._y = 72.0;
}
else {
if (local1_txt.htmlText == "Sydney") {
circle_mc._visible = true;
circle_mc._x = 387.0;
circle_mc._y = 72.0;
}
else {
This code doesn't retrieve any error but it just doesn't work. I also tried to make the mc always visible but it's positions stays always the same.
Can someone help me with this?
Thx in advance.
I'm kinda new in actionscript so I need your help on this. I'm trying to create a swf that gets vars (friend1;friend2;local1 and local2) from a txt file and insert it on the textboxs (instanced as box1_txt;box2_txt;local1_txt and local2_txt).
So far so good. I managed to do that with the folowing code:
myData = new LoadVars();
myData.onLoad = function(success){
if (success) {
box1_txt.htmlText = this.friend1;
box2_txt.htmlText = this.friend2;
local1_txt.htmlText = this.local1;
local2_txt.htmlText = this.local2;
}
}
else {
box1_txt.htmlText = "error loading variable";
box2_txt.htmlText = "error loading variable";
}
}
myData.load("example.txt");
But now I need to create 2 movieclips and its position (x,y) must change acording to the vars local1 and local2.
I must be doing something (completely) wrong. I tried to following code:
_root.circulo1_mc._visible = false;
if (local1_txt.htmlText == "Rome") {
circle_mc._visible = true;
circle_mc._x = 287.0;
circle_mc._y = 72.0;
}
else {
if (local1_txt.htmlText == "Sydney") {
circle_mc._visible = true;
circle_mc._x = 387.0;
circle_mc._y = 72.0;
}
else {
This code doesn't retrieve any error but it just doesn't work. I also tried to make the mc always visible but it's positions stays always the same.
Can someone help me with this?
Thx in advance.