Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Sub-Menu in MX

Status
Not open for further replies.

theKeyper

Technical User
Jun 11, 2003
79
AU
Hello everyone,
Sorry the subject line isn't real descriptive. It's a hard problem to describe. So either you can get the sample file right away at or you can wade through my poor descriptive skills.

Baisically When I roll over a button I want a submenu to pop up. This submenu is a movie clip that goes to frame (x) depending on what the submenu should contain. Then, as you roll over each button (4 in total), a small dot appears to the left of it as an Over state. When I click on the button I want the dot to stay there to give the user visual feedback of exactly where they are. To do this I have made a movie clip containing the dot and placed it above the button. Then, using the instance name I can make it visible or invisible depending on where the user is. To start with I have made them all invisible and this is where my problem occurs. When I roll over the button to bring up the submenu, all four dots are visible. only when I roll out and back over again does it work.

Some of the code might seem like a bit of a long way round to do things but this is because the final file is quite a bit more complex and I have tried to simplify it as much as possible in the sample.

Thank you so much for taking the time, I really appreciate it.
-Keyper
 
Are all of the instances of the dot MC named uniquely?


Wow JT that almost looked like you knew what you were doing!
 
Try this:

Place your button and "light" in a new MC ("myBtn"). Make the myBtn clip 2 frames and 3 layers. On layer 1 your button, on layer 2 your light, on layer 3 Actions.

Layer 1 should cover both frames, layer 2 frame 2 only.

Layer 1 Frame 1 Actions:
Code:
buttonClicked = false;
stop();

Button Actions:
Code:
on(rollOver){
	if(buttonClicked == false){
		this.gotoAndStop(2);
	}
}
on(rollOut){
	if(buttonClicked == false){
		gotoAndStop(1);
	}
}
on(release){
	if(buttonClicked == false){
		buttonClicked = true;
		gotoAndStop(2);
	}else{
		buttonClicked = false;
	}
}

Unfortunately I can't download your file here at work so I can't see how you built your submenu. But I believe that you will be able to refer to it in the button events above by using _parent.

You should also write a function to reset buttons when another one is moused over or clicked:

Code:
_global.resetButtons = function(){
   _root.button1.buttonClicked = false;
   _root.button2.buttonClicked = false;
}

I hope that is enough to get you going. I also hope it makes sense.

Let me know how it turns out.

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top