블로그 이미지
플래시로 밥먹고 살고 있습니다... 하지만 여긴 플래시 전문 블로그가 아닌 그냥 개인 블로그랍니다
미나토

Recent Comment

calendar

      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      
  • 56,002total
  • 9today
  • 173yesterday
2007/06/22 13:44 Flash Platform
var _width:Number = 200;
var _height:Number = 200;

var bd:BitmapData = new BitmapData(_width, _height, false);
for(var i:uint=0; i<_height; i++)
{
 for(var j:uint=0; j<_width; j++)
 {
  bd.setPixel(j, i, Math.random() * 0xFFFFFF);
 }
}

var bm:Bitmap = new Bitmap(bd);
addChild(bm);


var timer:Timer = new Timer(.01, 0);
timer.addEventListener(TimerEvent.TIMER, changeColor);
timer.start();

function changeColor(e:Event):void
{
 for(i=0; i<_height; i++)
 {
  for(j=0; j<_width; j++)
  {
   var color:uint = bd.getPixel(j, i);
   if(color > 0) color -= 0x111111;
   bd.setPixel(j, i, color);
  }
 }
}



as2.0 일 때 신경도 안쓰던 비트맵을 요즘 좀 보고 있다.... 흠... 흥미롭군...
크리에이티브 커먼즈 라이선스
Creative Commons License
posted by 미나토
TAG ,