A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: drag + rotate [¿still puzzled?]

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2000
    Location
    eu.rope
    Posts
    15

    drag + rotate [¿still puzzled?]

    i am working on a "stickman". its legs and arms should be rotatable around its joints. it works with a script like that one:

    http://www.flashkit.com/movies/Scrip...3436/index.php

    but, it has the sideffect that the rotatable part JUMPS to the mouseposition. it would be much nicer and more logic if the rotated object would keep a relative distance to the point from where the mouse drags it in circles. comparable to a simple drag-offset.

    hmm. after trying some trigonometry i gave up and searched the web, but couldn't find any answer.

    any experts around who could help me?

    fla is attached below

    merci ++

    lamb_retta
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Location
    eu.rope
    Posts
    15

    the answer



    as the offset of the rotatable object may only be on the x axis, one may
    calculate this difference from pivot point 0,0 on mouse down.
    by adding this difference on (enter frame) where we calculate the degree
    with some math formula we get what we want.

    check the fla for details

    ciao
    ramb_letta
    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