x_pos_main = 450;
y_pos_main = 0;
s = new Sound();
s.attachSound ("krach");
function buildSubMenu(wert){
cont = createEmptyMovieClip("mc_contain", 2);
cont._x = x_pos_main;
mc_x_pos = cont._x / 100;
txt_format = new TextFormat();
txt_format.font = "pixelfont";
txt_format.size = 8;
txt_format.color=0xFFFFFF;
arrText1 = [['OPEN','home'],['USEFUL TOOLS','skills'],['PIXELFONTS','dl']];
arrText2 = [['TUTORIALS','tut'],['FUNNY STUFF','fun'],['FREE SCRIPTS','scr']];
arrName = wert;
for(i=0;i<=_root[wert].length-1;i++) {
var length_button = 100;
var dist_button = 1;
tmpObj = _root.mc_contain.attachMovie("mc_fade_button", "mc_fade"+i, i, {_x:(length_button+dist_button)*(i-1)});
tmpObj._y = y_pos_main;
tmpObj._width = length_button; // breite button
tmpObj._height = 20; // hoehe button
tmpObj.id = i;
mc_width = tmpObj._width;
mc_height = tmpObj._height;
x_pos = (tmpObj._x-(tmpObj._width/2))+_root.mc_x_pos*tmpObj._width;
y_pos = tmpObj._y-(tmpObj._height/2);
// erstelle beschriftungen
tempText = _root.createTextField("txt_sub"+i, i+100, Math.round(x_pos), Math.round(y_pos), Math.round(mc_width), 30);
tempText = _root["txt_sub"+i];
tempText.text = _root[wert][i][0];
weite = _root["txt_sub"+i].textWidth;
length_button = weite;
tempText.embedFonts = true;
tempText.selectable = false;
tempText.autoSize = "center";
tempText.setTextFormat(txt_format);
// zeichne hintergrund für button
x_pos_rect = x_pos;
y_pos_rect = y_pos;
length_rect = tmpObj._width + (_root[wert].length-1);
heigth_rect = tmpObj._height;
mc = createEmptyMovieClip('mc'+i, i-10);
mc._x = x_pos_rect;
mc._y = y_pos_rect;
mc.beginFill(0x000000);
mc.lineTo (length_rect, 0);
mc.lineTo (length_rect, heigth_rect);
mc.lineTo (0, heigth_rect);
mc.lineTo (0, 0);
mc.endFill();
// button-fade funktionen
tmpObj.mc_button.onEnterFrame = function() {
!this.doit ? this.prevFrame() : this.nextFrame();
};
tmpObj.mc_button.bt_invisible.onRollOver = function() {
this._parent.doit = true;
};
tmpObj.mc_button.bt_invisible.onRelease = function() {
// getURL("javascript:"+arrText[this._parent._parent.id][1]+"()");
s.start(0,1) //die 1 ist die wiederholungszahl
}
tmpObj.mc_button.bt_invisible.onRollOut = function() {
this._parent.doit = false;
};
}
}
bt_mk1.onRelease = function(){
buildSubMenu('arrText1');
}
bt_mk2.onRelease = function(){
buildSubMenu('arrText2');
}
// loeschen des ganzen
_root.mc_sub.bt_invisible.onRelease = function(){
cont.removeMovieClip();
mc_sub._visible = false;
for (i=0; i<_root[arrName].length; i++) {
_root["txt_sub"+i].removeTextField();
_root["mc"+i].unloadMovie();
}
}