This is a blog about Flash & AS by betaruce :-)



Calendar

August 2007
M T W T F S S
« Jul    
  1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31  

November 21, 2005

Wood texture

Filed under: My Flash Programs — betaruce @ 12:54 am

This is certainly not the best way to make it, yet the effect is quite ok, and the code is quite simple~ you need fp8.5 to view it becoz it is made with AS 3.


package {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.util.*;

public class wood extends MovieClip {
public function wood() {
var bd:BitmapData=new BitmapData(300,300);
var bd2:BitmapData=new BitmapData(300,300);
var bd3:BitmapData=new BitmapData(300,300,false,0×996600);
var bd4:BitmapData=new BitmapData(300,300);
var b:Bitmap=new Bitmap(bd4);
bd.perlinNoise(400,100,1,128,false,true,1,true);
var ring:int=15;
for(var i:int=0;i<300;i++){
for(var j:int=0;j<300;j++){
var temp:Number=bd.getPixel(i,j)*ring;
bd2.setPixel(i,j,temp);
}
}
bd4.draw(bd2,new Matrix(),new ColorTransform(1,1,1,1,0,0,0,-70));
bd4.draw(bd3,new Matrix(),new ColorTransform(1,1,1,1,0,0,0,-30));
addChild(b);
}
}
}

• • •

No Comments »

No comments yet.

Comments RSS • TrackBack URI

Leave a comment

Powered by: WordPress • Template by: Priss

cheap phentermine phentermine site phentermine effects online phentermine phentermine prescription buy phentermine online phentermine alternatives phentermine deit pill cheap generic phentermine order phentermine online Clenbuterol Phentermine online pharmacy phentermine buy phentermine weight loss pill Cialis Comparison Viagra Cheap Viagra Online Prescription generic viagra sale viagra online viagra viagra pill discount sale viagra Generico Impotencia Viagra viagra sildenafil citrate Xanax Online xanax order xanax valium versus xanax