Liebe leute, ich habe in meiner sammlung ein tolles sript für ein dynamisches menue gefunden und es ab zeile
function und_menu(zw) verändert, sodaß sich bei
onPress eine URL öffnet. Tut sie auch. Aber auf allen buttons. Wie stelle ich es an, jeden einzelnen button mit einer URL zu definieren? Probiere schon seit Tagen, blicke es immer noch nicht. Für eure hilfe wäre ich dankbar.
PHP-Code:
hmenue_ary = ["section_1", "section_2", "section_3", "section_4", "section_5"];
umenu_ary = [];
umenu_ary[0] = ["sup_section 1_1", "sup_section 1_2", "sup_section 1_3"];
umenu_ary[1] = ["sup_section 2_1", "sup_section 2_2", "sup_section 2_3", "sup_section 2_4", "sup_section 2_5"];
umenu_ary[2] = ["sup_section 3_1", "sup_section 3_2", "sup_section 3_3", "sup_section 3_4"];
umenu_ary[3] = ["sup_section 4_1", "sup_section 4_2"];
umenu_ary[4] = ["sup_section 5_1", "sup_section 5_2", "sup_section 5_3", "sup_section 5_4"];
var mp = 10;
var xpos_hm = 60;
var ypos_hm = 40;
var btn_h = 20;
hbtn_yo = [];
hbtn_yn = [];
ubtn_enco = [];
hbtn_funk = [];
ubtn_funk = [];
sit = [];
for (x=0; x<hmenue_ary.length; x++) {
ubtn_funk.push([]);
ubtn_enco.push([]);
}
for (i=0; i<hmenue_ary.length; i++) {
this.attachMovie("base_btn", "main_btn"+i, i+1000, {_x:xpos_hm, _y:btn_h*i+ypos_hm});
this["main_btn"+i].i = i;
hbtn_yo.push(ypos_hm+btn_h*i);
hbtn_funk.push(this["main_btn"+i]);
hbtn_funk[i].texter.text = hmenue_ary[i];
und_menu(i);
hbtn_funk[i].onPress = function() {
if (hbtn_mv != this._name) {
hbtn_mv = this._name;
mm_i = this.i;
um_i = ubtn_funk[mm_i];
if (count != 1) {
move_out();
count = 1;
} else {
move_back();
}
}
};
}
function und_menu(zw) {
zw_i = umenu_ary[zw];
for (i1=0; i1<zw_i.length; i1++) {
this.attachMovie("menue_btn", zw_i[i1], -i1-(20*zw), {_x:xpos_hm, _y:hbtn_yo[zw]});
ubtn_funk[zw].push(this[zw_i[i1]]);
ubtn_funk[zw][i1].texter1.text = zw_i[i1];
ubtn_enco[zw].push(hbtn_yo[zw]+btn_h*(i1+1));
ubtn_funk[zw][i1].onPress = function() {
getURL("http://www.flashforum.de", "_blank");
};
}
}