PDA

View Full Version : sticky menus


silver charm
07-15-2004, 12:07 AM
I have tried the 'invisible button' method to get my menus to collapse (horizontal nav bar with vertical subs) but the prob -as far as i can see- is the buttons are too close together to get the proper acreage on the invisible button.

i have a text field that populates from the menus which are loaded via AS (not plopped on the stage).

the depths of everything:
-textfield=20
-containter mc_1=50
--menu mc_1=51
-container mc_2=60
--menu mc_2=61
-container mc_3=70
--menu mc_3=71

i know there are multiple ways to skin a cat-so here are the two methods i think can solve this. but i can't figure out either. :confused:

A) get my text field to go down in depth (but stay visible) with the buttons plopped on the stage. which i really don't think will fix the sticky menu problem
B) get the following code to work


//menu1_mc
this.menu1_mc.onRollOver = function() {
if(menu2 == 1){
menu2_mc.gotoAndPlay("collapsed");
trace ("menu2 collapse on menu1")
menu2 = 0;
}
if(menu3 == 1) {
menu3_mc.gotoAndPlay("collapsed");
trace ("menu3 collapse on menu1")
menu3 = 0;
}
if(menu1 == 0) {
menu1_mc.gotoAndPlay("expanded");
trace ("menu1 expand on menu1")
menu1 = 1;
}
};

any good ideas?????

silver charm
07-19-2004, 07:07 PM
okay i abadonded the previous attempt and am now trying to figure out the hitTest.

can someone take a look and see if anything looks amiss??? pretty please (i'm groveling at my keyboard)

i know it is repititious (how do you spell that anyways) but i'm a guppy in all this and as soon as i get this monkey off my back-i promise, i'm signing up for the next actionscript class.

[QUOTE]//create empyt movie clip to load industry menu
_root.createEmptyMovieClip("Pindustry_mc", 50);
Pindustry_mc._x=116;
Pindustry_mc._y=62;
Pindustry_mc.attachMovie("industry_mc", "industry", 51);

//use hitTest to check mouse location and if over industry-close practice & solutions
Pindustry_mc.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse)){
practice_mc.gotoAndPlay("collapsed");
//trace ("collapsing practice from industry");
solutions_mc.gotoAndPlay("collapsed");
//trace ("collapsing solutions from industry");
};
}

//create empty movie clip to load practice menu
_root.createEmptyMovieClip("Ppractice_mc", 60);
Ppractice_mc._x=279;
Ppractice_mc._y=62;
Ppractice_mc.attachMovie("practice_mc", "practice", 61);

//use hitTest to check mouse location and if over practice-close industry & solutions
Ppractice_mc.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse)){
industry_mc.gotoAndPlay("collapsed");
solutions_mc.gotoAndPlay("collapsed");
};
}

//create empty movie clip to load solutions menu
_root.createEmptyMovieClip("Psolutions_mc", 70);
Psolutions_mc._x=487;
Psolutions_mc._y=62;
Psolutions_mc.attachMovie("solutions_mc", "solutions", 71);

//use hitTest to check mouse location and if over solutions-close practice & industry
Psolutions_mc.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse)){
industry_mc.gotoAndPlay("collapsed");
practice_mc.gotoAndPlay("collapsed");
};
}

silver charm
08-09-2004, 10:13 PM
okay that didn't work either......

so i have now ripped the invisible buttons out of the individual mc's. and have one big mother of invisible button with code that says onRollover collapse menus.

but still NO LOVE.....

i think this might be the solution, though, but i am not targeting the mc's properly since they are on various depths.....

can somone PLEASE give me a hint on targeting various depths?????? or a link where this has been explained is greatly appreciated. i'm sure this has been dealt with, i'm just too obtuse to find it.

pretty please......

i'm begging........

silver charm
08-10-2004, 04:02 AM
yep. got it fixed.

big mother button worked. the trace(targetPath(this)) command is FREAKING BRILLANT.

many thanks for letting me think out loud.