as3.0如何实现点击按钮开始画线点击另一按钮停止画线 两按钮间画任意线
3个回答
展开全部
var paper_mc:MovieClip=new MovieClip();
addChild(paper_mc);
Mouse.hide();
paint_mc.startDrag(true);
paper_mc.graphics.lineStyle(6,0xff80199,1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,mou);
function mou(me:MouseEvent) {
paper_mc.graphics.moveTo(this.mouseX,this.mouseY);
}
stage.addEventListener(MouseEvent.MOUSE_UP,mop);
function mop(me:MouseEvent) {
paper_mc.graphics.lineTo(this.mouseX,this.mouseY);
}
addChild(paper_mc);
Mouse.hide();
paint_mc.startDrag(true);
paper_mc.graphics.lineStyle(6,0xff80199,1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,mou);
function mou(me:MouseEvent) {
paper_mc.graphics.moveTo(this.mouseX,this.mouseY);
}
stage.addEventListener(MouseEvent.MOUSE_UP,mop);
function mop(me:MouseEvent) {
paper_mc.graphics.lineTo(this.mouseX,this.mouseY);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询