dcsimg
A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: 3d lever...need a little help

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    3d lever...need a little help

    I have a lever, when you drag over it, it cycles through a jpeg sequence of the lever moving. when you push the lever forward, it stops at the end like it should, however if you pull it back it cycles back to frame 1.

    Can you help me?

    code:

    onClipEvent(load){
    stop();
    speed = 3;
    }
    onClipEvent(mouseDown){
    yRef = _root._ymouse;
    frameRef = _currentFrame;

    }
    onClipEvent(mouseMove){
    if (Key.isDown(1) && _root._ymouse>442 &&_root._ymouse<643 && _root._xmouse>680 &&_root._xmouse<899){
    frame = (frameRef + Math.floor((_root._ymouse - yRef)/speed)) % _totalframes;
    if (frame <= 1) frame = frame;
    gotoAndStop(frame);


    }


    }
    onClipEvent(mouseUp){
    gotoAndStop(frame);

    }
    Attached Files Attached Files

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