Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-30-2008, 11:31 PM   #1
sergxp
Registered User
 
Join Date: Dec 2005
Posts: 7
Default rectangle follow mouse in menu

I am making a navigation menu with a grey rectangle that follows the mouse when the mouse is over the menu bar. So far I have this
Code:
onClipEvent(enterFrame){
	if(_root._ymouse > 100){
		x = _x
		x_fin = _root._xmouse
		dx = x_fin-x
		dx /= 10
		_x += dx
	}
}
Right now all it does is follows the mouse with easing on the navigation bar. What I want it to do is is the following:
1) Follow the mouse only when the mouse is over the navigation bar area

2) Center align the rectangle with the mouse when it's over the mouse. Right now the left of the rectangle stops by the mouse. I want the rectangle to stop so the mouse is pointing at the center of the rectangle.

3) When clicking on a menu item, the rectangle should stop on that menu item. And when you start pointing with the mouse over the menu bar, the rectangle should follow the mouse but once the mouse leaves the menu bar area the rectangle should return to the menu item.

This should be simple for you actionscript savvy people. So if you're not busy help would be appreciated.
sergxp is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OOP: XML Menu mouse click? ronze ActionScript 3.0 0 06-19-2008 07:57 AM
MC follow mouse, then grab or catch it. SkateFreak ActionScript 2.0 1 08-30-2006 08:30 PM
Mouse scrolling menu w/ enlarging thumbs... CynicRP ActionScript 2.0 0 11-03-2005 08:52 PM
Advice: Mouse position issue with dock menu? SWiSH ActionScript 1.0 (and below) 1 10-03-2005 09:58 AM
onrollout follow the mouse, else stop following!! :D Gmaxx ActionScript 1.0 (and below) 1 09-23-2005 08:58 PM


All times are GMT. The time now is 06:29 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.