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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove submenu on rollout 1

Status
Not open for further replies.

firegambler

Technical User
Sep 25, 2002
455
AT
hi earthlings,

maybe sb could help me on that topic,

here ( ) i have a scrolling menu, containing a submenu on the first button. (here's the .fla )
i'd like the submenu to dissappear once the mouse leaves it.
at the moment it disappears when it is clicked or another button of the main menu is touched.

thanks a lot

firegambler
 
I'm assuming that the menu currently disappears on click becuase you have this code on the button...

on(release){

}

If so just change that to...

on(release,rollOut){
}
 
well the problem with that solution is that i cannot move the mouse to the second button of the submenu due to the fact that when i leave the first one the "rollout" command makes the submenu dissappear.
please, any other suggestions?

firegambler
 
If you embed your buttons in movieclips (just select them and change to symbol again) you can use hitTest() to detect if the mouse is over them then use a mouseDown event to catch if the user clicks on an option.

Instead of embedding buttons in theis way (although it works great) I use two frame movieclips as buttons with frame one being the normal state and frame two changed slightly to be the rollover state then use gotoAndStop to display the appropriate frame when the mouse is over the 'button'

You'll need to have this code within an onClipEvent(enterFrame) handler (in Flash 5) or as this.onEnterFrame=function(){} in MX.

Here's an MX example:

myClip.onEnterFrame = function() {
//handle 'rollover'
if (clip.hitTest(_root._xmouse, _root._ymouse, true)) {
clip.gotoAndStop(2);
} else {
//handle'rollout'
clip.gotoAndStop(1);
}
};
myClip.onMouseDown = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
myOtherClip.play();
}
};
 
Those are just general approaches so it might be hard to make it work straight away.

I've just finished an MX menu like this (drops down instead of pops up) for a client - it's pretty cool and really easy to customise. I can't upload it at the moment because I'm away from my home machine but if you want the .fla drop me your email address and I'll send it you this afternoon.
 
Little buggy Dave. If you roll the mouse down the menu before it completely finishes the drop down animation it starts over. Could be pretty annoying for someone with no patience..

Haven't talked with ya in a while, how's it going? Staying busy?

Carl
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
That's not a bug - Firegambler wanted a menu that disappeared on rollOut so the second you mouse over an area that the menu doesn't cover it retracts. You've got to keep hovering to get the menu. Not the kind of functionality I usually go for - I like things to stay put.

The actual menu's from something I did which doesn't rollback until an option or the top bar is clicked, I just added a line to adapt it for this thread.

Other than that keeping very busy, working on a CD-Rom in MX for Cisco just now (that's what this menu's for), just finished some stuff for IBM and Lexmark. But will be looking around again in a couple of weeks when this contract's over no doubt.

You busy?
 
Sorry Ewan I called you Dave..Yeh I have a had three html projects that came around, nothing to big..Finally landed a full time contractor position with a design firm here in Orlando..So they promise to keep me busy, will se how it goes..And my appoligies I did not know that was how he wanted the menu..

Have fun..

Carl
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
well, wangbar, i have to admit, that i do not understand the script you used yet and therefore i am shy to use it but i grapped your idea of using thist first empty keyframe in the submenu movie instead of making instances invisible. that really rocks - easy to use and many possibilities of animations (although i just made a little bounce for not being annoying after some time)

if you want you can have a look at it on
don't mind about the text on the page, that's just some kind of "internal" info for a friend.


i'd be pleased about getting a little feedback on the idea of the menu.
(the submenu is just done for the first button at the moment).

by the way, wangbar, when i saw your bouncy menue it nearly knocked me off my chair, especially as i knew that it was no tweening but programmed motion.
congrats!!


"":)"" firegambler [thumbsup2]
 
Fire gambler you need to make that menu reverse back on rollout instead of just dissapearing..

have fun..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
For that matter, also keep it from poping out again on a second press. If it's already out, it shouldn't re-start from scratch! Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top