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教程,动画技术