当前位置:软件学习 > Flash >>

as3实用的随机改变颜色代码

var dow:Boolean;
stage.addEventListener(MouseEvent.MOUSE_DOWN,down);
stage.addEventListener(MouseEvent.MOUSE_MOVE,Move);
stage.addEventListener(MouseEvent.MOUSE_UP,up);
function down(evt) {
 dow=true;
 this.graphics.lineStyle(2,rgb(),1);
 this.graphics.moveTo(mouseX,mouseY);
}
function up(evt) {
 dow=false;
}
function Move(evt) {
 if (dow) {
  this.graphics.lineTo(mouseX,mouseY);
 }
}
function rgb():uint {
 return (Math.random() * 0xffffff + 0xff000000);
}

补充:flash教程,动画技术
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,