PDA

View Full Version : slide out tab menu action!!


momoto
01-08-2002, 06:54 PM
I have created a menu contains several slide out tabs on single layer. But when a tab is open "onClick", other tabs above the opened tab can also be open, and creates overlapping tabs.

Do anyone know how can I write the script to avoid the open action of others tabs when "onClick" while one tab is open?

sky_doq
01-08-2002, 07:36 PM
Actualy I don't get it, but why don't you use the visibility of buttons in mc's ? Or:

Make them in different keyframes, so that there won't be any tabs below it.

momoto
01-08-2002, 08:16 PM
Sorry, I didn't make myself clear enough.

Actually I have another frame action on the same MC, so I can't use the frame action for the tabs. And I just want the rest of the tabs can't be activate while either one of them is open, but not making them invisible.

So, is there a script which can control the true/false of a menu?

I'm quite new to Flash, if you could help me I would be so thankful.

Billy T
01-08-2002, 10:39 PM
this might help...

PS Jesse made this file

momoto
01-08-2002, 10:59 PM
Thanks a lot Billy T!

But can you explain to me the meaning of this code fm your download file? What's "j" and why it's "<10" and what's "++" means?

function resetButtons () {
for (j=1; j<10; j++) {
_root["button"+j].gotoAndStop("up");
}
}


Sorry for my narrow knowledge in scripting!

Billy T
01-08-2002, 11:09 PM
j is just a variable used for targeting the button instances and to stop the function going on forever..

function resetButtons () {
//function called by clicking on a button
for (j=1; j<10; j++) {
//j starts at 1, while j is less than 10, j=j+1
//what this means is that the code beneath this will keep occuring and j will keep going up by one each time until j = 10
_root["button"+j].gotoAndStop("up");
//basically all the button clips (check their instance names) go to their up state (ie not clicked)
}
}


on the buttons

on (release) {
_root.resetButtons();
//this calls the functions (sends all the buttons to their up state)
this.gotoAndStop("down");
//this sends the clicked button to its down state
}

hope that helps

momoto
01-09-2002, 12:07 AM
How about my tabs are MC, which contain buttons?

So can I just change the script to


function resetMovies () {
for (j=1; j<10; j++) {
_root["movie"+j].gotoAndStop("Close Menu");
}
}


on the buttons:


on (press) {
_root.resetMovies();
this.gotoAndStop("Open Menu");
}

*with the instant names- movie1, movie2,....

Billy T
01-09-2002, 12:46 AM
correctamondo!!:cool:

momoto
01-09-2002, 02:05 AM
I don't know why it's still doesn't work on my mc. But I find another way to solve the problem.

Thank you Billy T. ;)