dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] [F8] onMouseMove navigaton?

  1. #1
    yeah yeah yeah sandyrivers's Avatar
    Join Date
    Jul 2002
    Location
    Jibblies!
    Posts
    480

    resolved [RESOLVED] [F8] onMouseMove navigaton?

    Hey gang,

    I know this is a tall order, but I was wondering if someone could give me some help in determining how to build an onMouseMove navigation for a site I'm working on. I've never done one before, so I'm having trouble wrapping my head around all of the pieces.

    I want to build something similar to the video nav on this site: http://www.iamsecond.com/

    The client wants a vertical nav, where the buttons sort of act like a ferris wheel. I thought the easiest way to do that would be to set up an MC, where I tween everything (the site will only be up for a few months and won't change, so I don't necessarily have to load the buttons dynamically) and then have the onMouseMove function scrub the playhead of the MC baack and forth. What I don't understand is the physics part of it... how to make the mc speed up or slow down based on the speed of the mouse movement...

    Any ideas? Not looking for a handout, just for some guidance and direction.

    Thanks in advance for any help!

    -Sandy

    PS: The code I've started tinkering with is below, but is is super basic at this point...

    code:
    checkY = function (dy, oldVal, newVal) {
    if (oldVal<newVal) {
    myMC._y += 10;
    } else if (oldVal>newVal) {
    myMC._y -= 10;
    }
    return newVal;
    };
    this.watch("ydir", checkY);
    this.onMouseMove = function() {
    if ((_xmouse>235) && (_xmouse<315)) {
    ydir = _ymouse;
    }
    };

    Sigs R4 Suckers! Wait... I mean.... nevermind...

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    Sandy,

    I've done something similar to this before using a horizontal scrolling menu and, basically, just got the difference between the oldVal and newVal and divided my "move" value by the difference...if that makes sense. I've also done it so it scrolls faster as you get farther from the center, but that's even easier, just divide by the distance of the pointer from the center...

    What they have on the iamsecond site is actually even easier...they're just taking a fixed scrolling area figuring the percentage of that that corresponds to their thumbnails and then moving the thumbnails proportionately...no easing or anything going on there...

    Hope that helps!!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  3. #3
    yeah yeah yeah sandyrivers's Avatar
    Join Date
    Jul 2002
    Location
    Jibblies!
    Posts
    480
    Hey Brian,

    Thanks for the reply. I found a component online that was pretty much exactly what I was looking for, so I'm just using that. Appreciate the reply though!

    -Sandy
    Sigs R4 Suckers! Wait... I mean.... nevermind...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center