Posted By

daisuke103 on 02/11/08


Tagged

data textmate pixel map sample bit bitmapData as2 dissolve


Versions (?)

AS2 BitmapData ディゾルブによりホワイトアウト


 / Published in: Other
 

  1. /* ここから */
  2. /*
  3. ディゾルブによりホワイトアウトする
  4. http://www.fumiononaka.com/Sample/Flash8/PixelDissolve.html
  5. リンケージPenのビットマップデータをロード
  6. */
  7. import flash.display.BitmapData;
  8. import flash.geom.Point;
  9. var myBitmapData:BitmapData = BitmapData.loadBitmap("Pen");
  10. var _mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
  11. _mc.attachBitmap(myBitmapData, _mc.getNextHighestDepth());
  12. var nRandom:Number;
  13. _mc.onPress = function() {
  14. nRandom = Math.floor(Math.random()*10);
  15. this.onEnterFrame = xDissolve;
  16. };
  17. var nTotalDissolved:Number = 0;
  18. var nTotalPixels:Number = myBitmapData.width*myBitmapData.height;
  19. var nDissolving:Number = 30;
  20. var zeroPoint:Point = new Point(0, 0);
  21. function xDissolve() {
  22. nRandom = myBitmapData.pixelDissolve(myBitmapData, myBitmapData.rectangle, zeroPoint, nRandom, nDissolving, 0x00FFFFFF);
  23. nTotalDissolved += nDissolving;
  24. if (nTotalDissolved>=nTotalPixels) {
  25. delete this.onEnterFrame;
  26. }
  27. nDissolving = Math.floor(nDissolving*1.1);
  28. }

Report this snippet  

You need to login to post a comment.