Thus, i tried to modify the previous Coordinate Rotation so that it look more simplifed. Do take note that due to the way i wrote my Vector Class, now the rotation will rotate in anti-clockwise direction if it a positive angle.
import Vector;
// angle to rotate in degrees var a:Number=1;
// define center pts var centerX:Number=cross._x; var centerY:Number=cross._y;
this.onEnterFrame=function():Void{
rotate();
}
function rotate():Void{
// return ball position in vector form relative to center pt var v:Vector=new Vector(ball._x-centerX,ball._y-centerY);
// rotate vector relative to center pt
v.rotate(a);
// add vector to center pt to get final position
ball._x=centerX+v.vx;
ball._y=centerY+v.vy;