hey
trying to calculate angel between two mc’s
came up with this
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]function[/COLOR] angle[COLOR=#000000]([/COLOR]ob1, ob2[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#000000]var[/COLOR] o1 = [COLOR=#0000FF]eval[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]var[/COLOR] o2 = [COLOR=#0000FF]eval[/COLOR]COLOR=#000000[/COLOR];
xDist = o1._x-o2.[COLOR=#0000FF]_x[/COLOR];
yDist = o1._y-o2.[COLOR=#0000FF]_y[/COLOR];
[COLOR=#0000FF]return[/COLOR] COLOR=#000000[/COLOR]-[COLOR=#000080]90[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
but there seems to be something wrong with that
its only returning negative angels
any ideas whats wrong with it?