| /* 没啥好说的,拿去用吧:) */ class Fire_ok extends MovieClip { var fireBmp, prevBmp, tempBmp, greyBmp, mtx, pnt, blurF, greyscaleCMF, fireCMF, dispMapF, webcam, fireBmpHolder, createEmptyMovieClip; var activityLevel_pb, wcGet ; function Fire_ok () { super (); fireBmp = new flash.display.BitmapData (400, 400, false, 0); prevBmp = fireBmp.clone (); tempBmp = fireBmp.clone (); greyBmp = new flash.display.BitmapData (400, 400, false, 16743424); mtx = new flash.geom.Matrix (); pnt = new flash.geom.Point (); blurF = new flash.filters.BlurFilter (7, 7, 1); greyscaleCMF = new flash.filters.ColorMatrixFilter ([0.73, 0.83, 0.93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]); fireCMF = new flash.filters.ColorMatrixFilter ([0.8, 0.05, 0, 0, 0, 0, 0.65, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0]); dispMapF = new flash.filters.DisplacementMapFilter (tempBmp, pnt, 1, 2, 10, - 35, "clamp"); ///////////////////////////////////////////////////// } function configUI () { fireBmpHolder = this.createEmptyMovieClip ("fireBmpHolder", 1); fireBmpHolder.attachBitmap (fireBmp, 1, "always", false); fireBmpHolder.blendMode = "add"; } function onEnterFrame () { tempBmp.copyPixels (prevBmp, prevBmp.rectangle, pnt); prevBmp.draw (webcam); if (tempBmp.getPixel (1, 1) < 2) { return (undefined); } tempBmp.draw (prevBmp, mtx, null, "difference"); tempBmp.applyFilter (tempBmp, tempBmp.rectangle, pnt, greyscaleCMF); tempBmp.threshold (tempBmp, tempBmp.rectangle, pnt, ">", 1638400, 4289379174, 16711680, false); tempBmp.applyFilter (tempBmp, tempBmp.rectangle, pnt, blurF); fireBmp.draw (tempBmp, mtx, null, "add"); tempBmp.perlinNoise (13, 10, 1, random (100) , false, true, 3, false); tempBmp.draw (greyBmp, mtx, null, "darken"); fireBmp.applyFilter (fireBmp, fireBmp.rectangle, pnt, dispMapF); fireBmp.applyFilter (fireBmp, fireBmp.rectangle, pnt, fireCMF); } static var CLASS_REF = Fire_ok; static var LINKAGE_ID = "Fire_ok"; } |
fireblue.rar(请用winrar2.7或以上版本)
admin#flashas.net (#为@) 联系QQ:
:40777822
浙ICP备06033001号