A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: 'ease' my pain

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    2

    'ease' my pain

    I'm using the onMouseWheel function to scroll the content which is all held in 'clip_mc' on my page. BUT, I'd also like to have this content easing out of it's motion if that's at all possible.

    Is there anything that can be added to the following or to clip_mc to do this?

    Code:
    mouseListener:Object = new Object();
    mouseListener.onMouseWheel = function(delta) {
     clip_mc._y += delta;
    }
    Mouse.addListener(mouseListener);
    I've searched forum after forum and only found one thing similar over at kirupa.com, but it deals with rotation. I can't fathom how to get it working on the _y axis. Any help or heads up on where to look would be greatly appreciated.

    Thanks in advance. :]

  2. #2
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    code:
    clip_mc.speed = 0;
    var mouseListener:Object = new Object();
    mouseListener.onMouseWheel = function(delta) {
    if (delta>0) {
    clip_mc.speed -= 40/8;
    } else {
    clip_mc.speed += 40/8;
    }
    };
    Mouse.addListener(mouseListener);
    clip_mc.onEnterFrame = function() {
    this._y += this.speed;
    this.speed *= 0.90;
    };




    aut.

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Posts
    2
    Austriaman, I can't thank you enough.

    I'll be forever in your debt for that one. :]

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