HiÑu unbg nen Trong Flash
m thu thập được một vài code hay về vẽ nên em post cho mọi người Vì chưa có hình nên em chưa
post hình được mong mọi người thông cảm.Chỉ cần coppy đoạn code dưới đây vào timeline chính
thôi
Code:
function drawPetal(clip:MovieClip, color:Number):Void {
clip.lineStyle(0, 0xFFFFFF, 40);
clip.beginFill(color, 20);
clip.moveTo(x[0], y[0]);
clip.curveTo(x[1], y[1], x[2], y[2]);
clip.curveTo(x[3], y[3], x[0], y[0]);
clip.endFill(x[0], y[0]);
}
// Define screen extents for later use...
Stage.scaleMode = "exactFit";
var middleX:Number = Stage.width/2;
var middleY:Number = Stage.height/2;
Stage.scaleMode = "noScale";
/*
create clip...
*/
paper = this.createEmptyMovieClip("paper", 1);
paper._x = middleX;
paper._y = middleY;
/*
Initialize points...
*/
var width:Number = 200;
var height:Number = 200;
var x:Array = new Array();
var y:Array = new Array();
drawPetal(petal, color);
if (counter>16) {
counter = 0;
}
};
code 2:
function drawPetal(clip:MovieClip, color:Number):Void {
clip.lineStyle(0, 0xFFFFFF, 100);
clip.moveTo(x[0], y[0]);
clip.curveTo(x[1], y[1], x[2], y[2]);
clip.curveTo(x[3], y[3], x[0], y[0]);
}
// Define screen extents for later use...
Stage.scaleMode = "exactFit";
var middleX:Number = Stage.width/2;
var middleY:Number = Stage.height/2;
Stage.scaleMode = "noScale";
// switch to low quality to enhance old school effect
_quality = "low";
/*
create clip...
*/
paper = this.createEmptyMovieClip("paper", 1);
paper._x = middleX;
paper._y = middleY;
/*
Initialize points...
*/
var width:Number = 200;
var height:Number = 200;
}
var petal = paper.createEmptyMovieClip("petal"+counter, counter);
drawPetal(petal, color);
if (counter>32) {
counter = 0;
}
};
code3:
var maxLines:Number = 100;
var lines:Number = 0;
var paper:MovieClip = this.createEmptyMovieClip("paper", 100);
paper.onMouseMove = function() {
lines++;
if (lines<maxLines) {
paper.lineStyle(3, 0xFF0000, 100);
paper.moveTo(250, 200);
paper.lineTo(_xmouse, _ymouse);
} else {
paper.clear();
lines = 0;
}
updateAfterEvent();
};
code 4:
function drawQuad(clip:MovieClip, color:Number):Void {
clip.clear();
clip.lineStyle(0, 0xFFFFFF, 70);
clip.beginFill(color, 50);
clip.moveTo(x[0], y[0]);
clip.lineTo(x[1], y[1]);
quad4._rotation = 270;
// Initialize points...
var width:Number = 100;
var height:Number = 100;
var x:Array = new Array();
var y:Array = new Array();
var sX:Array = new Array();
var sY:Array = new Array();
x[0] = 0;
y[0] = 0;
x[1] = 0;
y[1] = -height;
x[2] = -width;
y[2] = -height;
x[3] = -width;
y[3] = 0;
for (var i = 0; i<4; i++) {
sX[i] = (Math.random()*4)+4;
sY[i] = (Math.random()*4)+4;
}
this.onEnterFrame = function() {
for (i=0; i<4; i++) {
x[i] += sX[i];
y[i] += sY[i];
if (Math.abs(x[i])>200) {
sX[i] = -sX[i];
}
if (Math.abs(y[i])>200) {
sY[i] = -sY[i];
}
petal._y = middleY;
petal._rotation = i*(360/sectors);
}
// Initialize points...
var width:Number = 100;
var height:Number = 100;
var x:Array = new Array();
var y:Array = new Array();
var sX:Array = new Array();
var sY:Array = new Array();
x[0] = 0;
y[0] = 0;
x[1] = 0;
y[1] = -height;
x[2] = -width;
y[2] = -height;
x[3] = -width;
y[3] = 0;
for (var i = 0; i<4; i++) {
sX[i] = (Math.random()*4)+4;
sY[i] = (Math.random()*4)+4;
}
this.onEnterFrame = function() {
for (var i = 0; i<4; i++) {
x[i] += sX[i];
y[i] += sY[i];
if (Math.abs(x[i])>100) {
sX[i] = -sX[i];
}
if (Math.abs(y[i])>100) {