鼠绘引导线:
效果如下:用鼠标画一条引导线,小球将按引导线运动.
画一个球,或者你喜欢的任何玩意儿,转换为MC,实例名称为:ball_mc.
然后在帧动作面板中输入:
var a:Array;
this.onMouseDown = function() {
this.lineStyle(1, 0x0000ff, 100);
a = new Array();
a.push(_xmouse, _ymouse);
this.moveTo(_xmouse, _ymouse);
this.onMouseMove = function() {
a.push(_xmouse, _ymouse);
this.lineTo(_xmouse, _ymouse);
};
};
this.onMouseUp = function() {
delete this.onMouseMove;
var z:Number = new Number();
this.onEnterFrame = function() {
ball_mc._x = a[z++];
ball_mc._y = a[z++];
if(z>a.length){
delete onEnterFrame;
this.clear();
};
}
};