LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




ReplyREPLY THREAD
 
Thread Tools Display Modes
  #1  
Old 05-12-2004, 07:32 AM
nickwilmot nickwilmot is offline
Registered User
 
Join Date: May 2004
Location: florida
Posts: 1
Rep Power: 0
nickwilmot is on a distinguished road
Question MC following mouse in certain area

Hello... this is my first post on the forum but I look forward to plenty more. Anyway, In the works of a navigation menu I was looking to have a wheel(see below) follow the mouse, but only in a certain area. Here's what I mean :

[swf x=600 y=480]http://home.comcast.net/~donwilmot/abc1.swf[/swf]

where the wheel moves on the right I would like it to move just along that white stripe. I tried searching everywhere and could'nt find what I was looking for. Hopefully someone might be able to steer me in the right direction. I also read somewhere about using hit test? I couldnt seem to get that to work well.

the code I'm using right now is:

onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
if(this._x<=604.5){
this._x=603;
}
if(this._x>=640){
this._x=639;
}
if(this._y<=65){
this._y=66;
}
if(this._y>=458){
this._y=457;
}

}

Thanks in advance for any help!
Reply With Quote
  #2  
Old 05-12-2004, 11:59 AM
prisma prisma is offline

Super Moderator
 
Join Date: May 2001
Location: Munich, Germany
Posts: 1,668
Rep Power: 14
prisma is on a distinguished road
You whould have to find a mathematical function to calculate the x value with the y value, which descibes your white line.
Your line looks much like a parabola, so that whould probably be the way to go.
Example:
Actionscript:
onClipEvent (enterFrame) {
   if (_root._ymouse < 66) {
      this._y = 66;
   } else if (_root._ymouse > 457) {
      this._y = 457;
   } else {
      this._y = _root._xmouse;
   }
   this._x = 640- 36*Math.pow((this._y-262)/196, 2);
}
You've got to try around with these numbers.
__________________
... take me to your coder.
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Follow Mouse (only in certain area)? codeoverride Flash CS3 / Flash 9 0 10-09-2009 06:58 PM
move mouse within circle fabgar Flash MX ActionScript 0 03-22-2006 04:14 PM
local mouse postion chris12295 Flash MX ActionScript 1 06-02-2004 12:01 AM
Button HIT area makes mouse alternate between Pointer and Hand?? GavinJones Flash MX 2 12-07-2002 05:45 PM
mouse checking in specific frame yan Flash 5 Actionscript 4 06-25-2001 07:15 PM




All times are GMT. The time now is 05:29 AM.