A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: x_mouse

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    22

    x_mouse

    hi,

    am stuck on what appears to be a simple thing yet am struggling

    trying to make a mouse responsive slideshow (left-right)

    cant get it to scroll correctly so one image is centered

    fla attached

    thanks!!!

    ---------

    xm = 0;

    function xpos(bar_length,mul)
    {
    hpos = 0;
    scroll_length = 500;
    incr = bar_length/scroll_length;
    xm = _xmouse;
    if(_xmouse <= 100){xm = 0;}
    if(_xmouse >= 2500){xm = 2500;}
    scroll_x = hpos - xm;
    scroll_x = scroll_x * mul;
    x_pos = scroll_x * incr;
    x_pos = x_pos + hpos;
    return x_pos;
    }

    _root.onEnterFrame = function ()
    {

    x_pos = xpos(0,.20);
    with (bar)
    {
    _x += (x_pos - _x)*.2;
    }

    x_pos = xpos(2500,.75);
    with (menu)
    {
    _x += (x_pos - _x)*.2;
    }

    }
    Attached Files Attached Files

  2. #2
    Senior Member tokyo_sky's Avatar
    Join Date
    Oct 2004
    Location
    Tokyo
    Posts
    201
    do you mean like this???
    Attached Files Attached Files
    A spark of light in a dark wibbly wobbly world

  3. #3
    Senior Member tokyo_sky's Avatar
    Join Date
    Oct 2004
    Location
    Tokyo
    Posts
    201
    i did the first one by editing the movie clip if you edit it in a new page you will see a small cross that is the reference point, so your code worked only the MC was off center...

    here is a way to do it with action script appologies for the crappy buttons
    Attached Files Attached Files
    A spark of light in a dark wibbly wobbly world

  4. #4
    Junior Member
    Join Date
    Aug 2004
    Posts
    22
    thanks a lot

    but still cant get it right

    it is still very "jumpy" and cannot get the first and last square centered on the stage...esp. the first one


  5. #5
    Senior Member tokyo_sky's Avatar
    Join Date
    Oct 2004
    Location
    Tokyo
    Posts
    201
    ok its 4am here and i need sleep... when you say centered on the stage do u mean u want them to stop and not to keep moving? or you want them to click into place? heres another...
    Attached Files Attached Files
    A spark of light in a dark wibbly wobbly world

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