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!

mouse over overlap problem

Status
Not open for further replies.

zircon99

Programmer
Dec 4, 2006
10
GB
Hi there,

I am working on a new flash website. I have some mouse over problem. Can any one help me in this regard?

I am loading an external movie ‘nav.swf ‘ in to ‘xyz.swf’. The ‘nav.swf’ is a mouse over drop down menu navigation and ‘xyz.swf’ has also got a mouse over speech bubble. When the user rolls his mouse over the navigation, the navigation drops down and overlaps on the ‘xyz.swf’ roll over. When the user tries to roll over on the drop down menu, the roll over of xyz.swf’ also activates and makes the life terrible. How can I get rid of this problem?

Thanks,
 
Thanks Kenneth,

Can you please eloborate more about this, I am newbie to flash.

Thanks,
 
Let's say you have a MovieClip "mcNavBtn" in your "nav.swf", and a MovieClip "mcBaseBtn" in your "xyz.swf".
Code:
// nav.swf main timeline
mcNavBtn.onRollOver = function():Void  {
	trace("mcNav rollover");
	_parent.mcBaseBtn.enabled = false;
};
mcNavBtn.onRollOut = function():Void  {
	_parent.mcBaseBtn.enabled = true;
};
So when you rollover mcNavBtn, it disables mcBaseBtn in the parent movie ("xyz.swf"), and enables again on rollout.


Kenneth Kawamoto
 
Thanks Kenneth, Is there any other way round to do it? Coz, I have got more than 60 pages to load this navigation file 'nav.swf'. Can we add some code only in 'nav.swf' file?

Thanks,
 
If you have two over wrapping MovieClips, only the top one receives mouse event. Therefore, if your nav.swf has a MovieClip same size as xyz.swf and covers entire region of xyz.swf, MovieClips in xyz.swf will not receive the mouse event.

This MovieClip in nav.swf has to have a mouse event handler assigned, otherwise MovieClips underneath will receive mouse events. This MovieClip also needs to be alpha 0 so that you can see through what’s underneath (xyz.swf). You want to assign a mouse event hander to this MovieClip only when navigation buttons in nav.swf are rolled over, so that you can interact with xyz.swf normally when the navigation buttons are not active.

The simple example (the covering MovieClip is called "mcCover"):
Code:
// nav.swf
mcNavBtn.onRollOver = function():Void  {
	trace("mcNav rollover");
	mcCover.onRollOver = doNothing;
};
mcNavBtn.onRollOut = function():Void  {
	delete mcCover.onRollOver;
};


Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top