|
AS代码如下:
//这个函数是用来绘制线条的 function connect(){ this.clear() this.lineStyle(3,0x660000,100) this.moveTo(anchorOne._x,anchorOne._y) this.curveTo(controlOne._x,controlOne._y,anchorTwo._x,anchorTwo._y) updateAfterEvent() } //这个函数是用来绘制替代描点跟控制点的MC,就绘制一个正方形吧 function createSquare(handle,side,offset){ if(offset==undefines){ offset=0 } with(handle){ moveTo(offset,offset) lineTo(offset,side) lineTo(side,side) lineTo(side,offset) lineTo(offset,offset) endFill() } } //这是用来控制描点跟控制点的移动,并且用延时,间隔一段时间调用一次绘制线条 function setDraggable(handle){ handle.onPress=function(){ clearInterval(_global.refreshScreen) _global.refreshScreen=setInterval(this._parent,"connect",10) this.startDrag(false) } handle.onRelease=function(){ clearInterval(_global.refreshScreen) this.stopDrag() } handle.onReleaseOutside=function(){ clearInterval(_global.refreshScreen) this.stopDrag() } } //建立描点 anchorOne=createEmptyMovieClip("anchorPoint1",this.getNextHighestDepth())
[1] [2] 下一页
|