请教关于 flash 问题:

来源:百度知道 编辑:UC知道 时间:2024/06/04 05:43:35
我想做一段剪辑,功能是:拖动画面上的铅笔移动时,会模拟铅笔画出曲线来,
请问如何做?谢谢

this.onMouseDown = function() {
this._p = 1;
p_x = this._xmouse;
p_y = this._ymouse;
};
this.onMouseUp = function() {
this._p = 0;
};
this.onEnterFrame = function() {
if (this._p == 1) {
this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.lineStyle(1, 0xff00ff, 100, true);
mc.moveTo(p_x, p_y);
mc.lineTo(this._xmouse, this._ymouse);
p_x = this._xmouse;
p_y = this._ymouse;
}
};

简单写了个,鼠标点击划线,抬起停止划线。至于铅笔的部分你自己搞定吧。

先选择铅笔然后选择左边的铅笔分类里面有个像曲线一样的符号点一下,然后就可以在屏幕上画出铅笔的曲线了.