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(); var sX:Array = new Array(); var sY:Array = new Array(); var counter:Number = 0; var color:Number = 0x000000; 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 (i=0; i<4; i++) { sX[i] = (Math.random()*20)+10; sY[i] = (Math.random()*20)+10; } paper.onEnterFrame = function() { counter++; color += 0x010305; for (var i = 0; i<4; i++) { x[i] += sX[i]; y[i] += sY[i]; if (Math.abs(x[i])>width) { sX[i] = -sX[i]; } if (Math.abs(y[i])>height) { sY[i] = -sY[i]; } } var petal = paper.createEmptyMovieClip("petal"+counter, counter); 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 x:Array = new Array(); var y:Array = new Array(); var sX:Array = new Array(); var sY:Array = new Array(); var counter:Number = 0; var color:Number = 0x000000; 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 (i=0; i<4; i++) { sX[i] = (Math.random()*8)+4; sY[i] = (Math.random()*8)+4; } paper.onEnterFrame = function() { counter++; color += 0x010305; for (var i = 0; i<4; i++) { x[i] += sX[i]; y[i] += sY[i]; if (Math.abs(x[i])>width) { sX[i] = -sX[i]; } if (Math.abs(y[i])>height) { sY[i] = -sY[i]; } } 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]); clip.lineTo(x[2], y[2]); clip.lineTo(x[3], y[3]); clip.endFill(x[0], y[0]); } // // Define colors var color1:Number = 0xDD8000; var color2:Number = 0xAACC00; var color3:Number = 0xFFF287; var color4:Number = 0x6699FF; // 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 . var quad1:MovieClip = this.createEmptyMovieClip("quad1", 100); quad1._x = middleX; quad1._y = middleY; var quad2:MovieClip = this.createEmptyMovieClip("quad2", 2); quad2._x = middleX; quad2._y = middleY; quad2._rotation = 90; var quad3:MovieClip = this.createEmptyMovieClip("quad3", 3); quad3._x = middleX; quad3._y = middleY; quad3._rotation = 180; var quad4:MovieClip = this.createEmptyMovieClip("quad4", 4); quad4._x = middleX; quad4._y = middleY; 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]; } } drawQuad(quad1, color1); drawQuad(quad2, color2); drawQuad(quad3, color3); drawQuad(quad4, color4); }; code5: function drawQuad(clip:MovieClip, color:Number):Void { clip.clear(); clip.lineStyle(0, 0xE0E0E0, 100); clip.beginFill(color, 10); clip.moveTo(x[0], y[0]); clip.lineTo(x[1], y[1]); clip.lineTo(x[2], y[2]); clip.lineTo(x[3], y[3]); 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"; var sectors:Number = 16; var color:Number = 0xDD8000; var petalColor:Number = color; var petal:MovieClip; // create clips . for (i=0; i<sectors; i++) { petal = this.createEmptyMovieClip("petal"+i, i); petal._x = middleX; 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) { sY[i] = -sY[i]; } } for (i=0; i<sectors; i++) { petal = this["petal"+i]; petalColor = color+(i*0x0F0F0F); drawQuad(petal, petalColor); } }; . 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ì