brutteforcce
Technical User
I made an action for the buttons of my site and now I want to generalize that action.
This is the action that I used for the first button...
on (rollOver) {
if (release_about_us==0) {
txt_about_us.gotoAndPlay("txt_init");
disp_about_us.gotoAndStop("disp_init");
}
}
on (rollOut) {
if (release_about_us==0) {
txt_about_us.gotoAndPlay("trans_txt");
disp_about_us.gotoAndPlay("trans_disp");
}
}
on (release) {
if (release_about_us==0) {
release_about_us=1;
sa_about_us.gotoAndPlay("selectie_albastru");
select_about_us.gotoAndPlay("selectie_buton");
gotoAndPlay("mutare_meniu");
if (release_products==1) {
txt_products.gotoAndPlay("trans_txt");
disp_products.gotoAndPlay("trans_disp");
release_products=0;
}
if (release_servicii==1) {
txt_servicii.gotoAndPlay("trans_txt");
disp_servicii.gotoAndPlay("trans_disp");
release_servicii=0;
}
if (release_contacts==1) {
txt_contacts.gotoAndPlay("trans_txt");
disp_contacts.gotoAndPlay("trans_disp");
release_contacts=0;
}
if (release_forum==1) {
txt_forum.gotoAndPlay("trans_txt");
disp_forum.gotoAndPlay("trans_disp");
release_forum=0;
}
}
}
I want to change in all of the names the text "about us" in 1, the text "products" in 2 and so forth.
I made this action:
for (i=1; i<5; i++) {
this["buton"+i].onRollOver = function() {
this["txt"+i].gotoAndPlay("txt_init");
this["disp"+i].gotoAndStop("disp_init");
}
this["buton"+i].onRollOut = function() {
this["txt"+i].gotoAndPlay("trans_txt");
this["disp"+i].gotoAndPlay("trans_disp");
}
}
stop();
just for testing if I can use the i variable in all the names and it isn't working...
I hope you understand me, if not ask...
Please try to help me...
Thanks!!!
This is the action that I used for the first button...
on (rollOver) {
if (release_about_us==0) {
txt_about_us.gotoAndPlay("txt_init");
disp_about_us.gotoAndStop("disp_init");
}
}
on (rollOut) {
if (release_about_us==0) {
txt_about_us.gotoAndPlay("trans_txt");
disp_about_us.gotoAndPlay("trans_disp");
}
}
on (release) {
if (release_about_us==0) {
release_about_us=1;
sa_about_us.gotoAndPlay("selectie_albastru");
select_about_us.gotoAndPlay("selectie_buton");
gotoAndPlay("mutare_meniu");
if (release_products==1) {
txt_products.gotoAndPlay("trans_txt");
disp_products.gotoAndPlay("trans_disp");
release_products=0;
}
if (release_servicii==1) {
txt_servicii.gotoAndPlay("trans_txt");
disp_servicii.gotoAndPlay("trans_disp");
release_servicii=0;
}
if (release_contacts==1) {
txt_contacts.gotoAndPlay("trans_txt");
disp_contacts.gotoAndPlay("trans_disp");
release_contacts=0;
}
if (release_forum==1) {
txt_forum.gotoAndPlay("trans_txt");
disp_forum.gotoAndPlay("trans_disp");
release_forum=0;
}
}
}
I want to change in all of the names the text "about us" in 1, the text "products" in 2 and so forth.
I made this action:
for (i=1; i<5; i++) {
this["buton"+i].onRollOver = function() {
this["txt"+i].gotoAndPlay("txt_init");
this["disp"+i].gotoAndStop("disp_init");
}
this["buton"+i].onRollOut = function() {
this["txt"+i].gotoAndPlay("trans_txt");
this["disp"+i].gotoAndPlay("trans_disp");
}
}
stop();
just for testing if I can use the i variable in all the names and it isn't working...
I hope you understand me, if not ask...
Please try to help me...
Thanks!!!