Is there anyway to make an arrow point to a moving movie clip, besides moving the arrow every frame?
Umm…give more detail…Im not 100% sure what you mean.
like a little moving movie clip… lets use ‘~’ for now… then there would be an arrow at the bottom of the movie, and as ‘~’ moved, the arrow would keep pointing to it.
[edit=oops, it didnt save the spaces…]
something like that…
just thought of a good way to explain it…
its like those movies that have the eyes following your cursor, but I want the eyes to be an arrow, and follow a movie clip instead…
You get the angle between your clip and the clip you want to follow (with Math.atan2) and then you set the angle. If you know your trigonometry, it’s a walk in the park.
pom 0]
heh… sorry, Im just now passing Pre-Algebra (7th Grade)… can someone explain to me in a little more detail? :lol:
hmmm… still doesnt seem to like me… any chance someone could try and make a .fla where it follows a clip instead of the mouse… or make it follow the mouse and explain how to make it follow the clip :lol:
Ok, here’s what you need : in the first frame of your animation
MovieClip.prototype.follow = function (destx,desty) {
        // destx is the x coordinate of what you want to follow
        // same for y
        var distx = destx - this._x ;
        var disty = desty - this._y ;
        var angle = Math.atan2(disty,distx) ; //angle in radians
        angle *= 180/Math.PI ; //angle in degrees
        this._rotation = angle ;
}
Then if you want a movie clip to follow the mouse, it’s
onClipEvent (enterFrame) {
        follow (_root._xmouse,_root._ymouse) ;
}
If you want it to follow the clip ** guide** that is in _root, it will be
onClipEvent (enterFrame) {
        follow (_root.guide._x,_root.guide._y) ;
}
pom 0]
got it to work!! Thanks pom
Prototypes rock, don’t they ??
pom 0]