用Math.atan2实现mc随鼠标转动,
代码如下(其中的arrow是库里面链接为"arrow"的mc):
this.createEmptyMovieClip("outer_mc", 1);
outer_mc.attachMovie("arrow", "a_mc", 1);
outer_mc._x = Stage.width/2;
outer_mc._y = Stage.height/2;
outer_mc.onMouseMove = function() {
var radin:Number = Math.atan2(this._ymouse, this._xmouse);
var degree:Number = radin*(180/Math.PI);
this.a_mc._rotation = degree;
};
实例:http://zeo.blogbus.com/files/1168044355.swf