A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: image scroller

  1. #1
    Member
    Join Date
    Feb 2001
    Posts
    63

    image scroller

    I'm in the process of making one of those nice image scrollers that you see all over the place, but am having a bit of trouble with the mouse co-ordinates.

    Basically, I can get the X position working, just about, but the Y position is a mystery to me. I want the scroll to only occur when the mouse pointer is within the confines of the menu, not at any point on the screen as is currently the case.

    Here's the troublesome code...

    xm = 0;
    //function to set the xpos of the movieclip
    function xpos(bar_length,mul)
    {
    hpos = 0;
    scroll_length = 840;
    incr = bar_length/scroll_length;
    xm = _xmouse;
    if(_xmouse <= 10){xm = 10;}
    if(_xmouse >= 450){xm = 450;}
    scroll_x = hpos - xm;
    scroll_x = scroll_x * mul;
    x_pos = scroll_x * incr;
    x_pos = x_pos + hpos;
    return x_pos;
    }

    onEnterFrame = function ()
    {

    // call function xpos
    x_pos = xpos(950,.70);
    with (scroller)
    {
    _x += (x_pos - _x)*.4;
    }

    }

    I've posted the files for you to have a look at.

    Any help would be appreciated...
    Attached Files Attached Files
    Insert witty comments here...

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