hey guys.
what i have is a MC WHICH SCROLLS and makes random blocks it is all coded and i want it so every 50 it makes a text feild with the number it is.
i have two main vars.
i : the var which i use to give each block a number.
for eg i do the code createNewMovie…“block”+i…etc.
and the var;
ypos : tells where to place the next block.
so as i said i want a text box with the number in it.
i have this code atm(NOT working);
if (i == 50) {
_root.map.createTextField("my_txt50", _root.getNextHighestDepth(), 0, ypos-30, 20, 100);
my_txt50.multiline = true;
my_txt50.wordWrap = true;
my_txt50.text = i;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.bold = true;
my_txt50.setTextFormat(my_fmt);
}
if (i == 100) {
_root.map.createTextField("my_txt100", _root.getNextHighestDepth(), 0, ypos-30, 20, 100);
my_txt100.multiline = true;
my_txt100.wordWrap = true;
my_txt100.text = i;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.bold = true;
my_txt100.setTextFormat(my_fmt);
}
if (i == 200) {
_root.map.createTextField("my_txt200", _root.getNextHighestDepth(), 0, ypos-30, 20, 100);
my_txt200.multiline = true;
my_txt200.wordWrap = true;
my_txt200.text = i;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.bold = true;
my_txt200.setTextFormat(my_fmt);
}
if (i == 150) {
_root.map.createTextField("my_txt150", _root.getNextHighestDepth(), 0, ypos-30, 20, 100);
my_txt150.multiline = true;
my_txt150.wordWrap = true;
my_txt150.text = i;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.bold = true;
my_txt150.setTextFormat(my_fmt);
}
although i would prefer something like this;
_root.map.createTextField("my_txt"+i, _root.getNextHighestDepth(), 0, ypos-30, 20, 100);
"my_txt"+i.multiline = true;
"my_txt"+i.wordWrap = true;
"my_txt"+i.text = i;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.bold = true;
"my_txt"+i.setTextFormat(my_fmt);
}
or something similar to that, because we all know that won’t work
What does happen atm?
it creates ALL the text boxes at block 200 (the last one).
any ideas?