A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Basic trigonometry help

  1. #1
    Senior Member
    Join Date
    Aug 2003
    Posts
    438

    Basic trigonometry help

    I have an arrow, and I want it to spin according to where the mouse is:

    code:
    onClipEvent (enterFrame) {
    diry = _root.sign._y-_ymouse;
    dirx = _root.sign._x-_xmouse;
    angle = Math.atan2(diry, dirx);
    degrees = angle/(Math.PI/180);
    setProperty("_root.sign", _rotation, degrees);
    }



    This script doesn't exactly work . Does anybody know what is wrong with it?
    Thanks!
    Last edited by Scorpion990; 05-02-2004 at 12:12 PM.

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