Rotating a mc to point at another mc

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Rotating a mc to point at another mc

    I thought I had this one right but it does not work
    I want the direction of the arrows to be in relation to each other as one is
    dragged around
    I used this code on the moveable arrow and put a text box on stage to check
    that the variable '.root.direction' is working

    onClipEvent (enterFrame)
    Radians = Math.atan2((this._y-_root.arrow1._y), (this._x-_root.arrow1._x))
    _root.direction = Math.round(Radians*180/Math.PI)+" degrees"
    _rotation=_root.direction


    For some reason it will not rotate with the variable
    If I change the variable with a number it rotates
    What am I doing wrong
    This is my .fla fil

    [url]http://wgadesign.com/direction.fl[/url]

    Canbrit1000 Guest

  2. Similar Questions and Discussions

    1. the angle from point A to point B (where the mouse is)
      i'm trying to figure out the angle between a point in my sceane and the point at which the mouse has been clicked. i've been looking at 3dD world...
    2. Getting a camera to point at one point
      Hi, I've got a room where I can interpolate the camera to various models wihtin it by clicking on certain buttons. Once a button has been hit I...
    3. Add Point tool won't add point
      I'm an Illustrator novice. I was tearing my hair out trying to get the add point tool to add a point to a path. It refused. I finally got it to work...
    4. Rotating
      how do I rotate a primitive/model without rotating it's own axis system. example - When creating a cone, it is created with it's sharp end pointing...
    5. The best way to rotate point around other point ?
      Hi, I need to rotate point in space around other point in space (not 0,0,0) and all three axis - different angles. Plz can you help me ? I will do...
  3. #2

    Default Re: Rotating a mc to point at another mc

    I just answered my own question. I was being stupid as usual and forgot that I had added text to the variable.
    What a dodo. *lol*
    Canbrit1000 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139