Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : Rotating a mc to point at another mc


Canbrit1000
2/15/2004 11:01:51 PM
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

http://wgadesign.com/direction.fl
Canbrit1000
2/15/2004 11:26:22 PM
I just answered my own question. I was being stupid as usual and forgot that I had added text to the variable.
AddThis Social Bookmark Button