hi,
i want to make 4 buttons (movieclip+text) with a for iteration.
first i make the movieclips(rectangles) and then i do
movieclip.addchild(textfield)
here is my one and only code:
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class Document extends flash.display.MovieClip {
public function Document() {
var hoofdmenuTeksten:Array = new Array("STUBRU", "SPORZA", "KETNET", "KLARA");
var mcsVanHoofdmenu:Array = new Array();
for (var i = 0; i < 4; i++) {
mcsVanHoofdmenu.push(new MovieClip());
mcsVanHoofdmenu*.graphics.beginFill(0x000000);
mcsVanHoofdmenu*.graphics.drawRect(0, 0, 98, 25);
mcsVanHoofdmenu*.graphics.endFill();
mcsVanHoofdmenu*.x = 361 + 99 * i;
mcsVanHoofdmenu*.y = -5;
var myText:TextField = new TextField();
myText.text = hoofdmenuTeksten*;
myText.x = 361 + 99 * i;
myText.y = 2;
myText.selectable = false;
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Verdana";
myFormat.size = 12;
myFormat.color = 0xFFFFFF;
myFormat.bold = true;
myText.setTextFormat(myFormat);
mcsVanHoofdmenu*.addChild(myText);
addChild(mcsVanHoofdmenu*);
}
}
}
}
now, i get the text behind the movieclips, what’s the reason of this?
here a screenshot:
thx for any help