做了个flash对mc移动的控制,代码很简单:)

复制代码 代码如下:

里面创建了4个MC,分别是zzcn_top_mc zzcn_end_mc zzcn_left_mc zzcn_right_mc .

很简单的。。大家可以参考下哦。。呵呵。。

var place_x:Number = _xmouse;
var place_y:Number = _ymouse;
var sulv:Number = 6;
zzcn_top_mc.onEnterFrame = function(){
    this._x += (place_x - this._x)/sulv;
    place_x = _xmouse;
    };
zzcn_end_mc.onEnterFrame = function(){
    this._x += (place_x - this._x)/sulv;
    place_x = _xmouse;
    };
zzcn_left_mc.onEnterFrame = function(){
    this._y += (place_y - this._y)/sulv;
    place_y = _ymouse;
    };
zzcn_right_mc.onEnterFrame = function(){
    this._y += (place_y - this._y)/sulv;
    place_y = _ymouse;
    };


http://www.zzcn.net/blog/attachments/month_0612/l2006121018639.swf