1월, 2008의 게시물 표시

ColorMatrixFilter

import flash.filters.ColorMatrixFilter; import mx.transitions.Tween; import mx.transitions.easing.*; System.security.allowDomain("http://www.helpexamples.com"); var mclListener:Object = new Object(); mclListener.onLoadInit = function(target_mc:MovieClip):Void { // center movie clip instance on Stage target_mc._x = (Stage.width - target_mc._width) / 2; target_mc._y = (Stage.height - target_mc._height) / 2; target_mc.watch("brightness", brightnessWatcher, target_mc); // animate the target_mc movie clip between -100 and +100 brightness var myTween:Tween = new Tween(target_mc, "brightness", Elastic.easeOut, 100, -100, 3, true); myTween.onMotionFinished = function() { this.yoyo(); }; }; this.createEmptyMovieClip("img_mc", 10); var img_mcl:MovieClipLoader = new MovieClipLoader(); img_mcl.addListener(mclListener); img_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", img_mc); function b...

ConvolutionFilter (회선변경)

import flash.filters.ConvolutionFilter; import flash.display.BitmapData; this.createEmptyMovieClip("shape_mc", 1); shape_mc.createEmptyMovieClip("holder_mc", 1); var imageLoader:MovieClipLoader = new MovieClipLoader(); imageLoader.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", shape_mc.holder_mc); var matrixArr:Array = [1, 4, 6, 4, 1, 4, 16, 24, 16, 4, 16, 6, 24, 36, 24, 6, 4, 16, 24, 16, 4, 1, 4, 6, 4, 1]; var convolution:ConvolutionFilter = new ConvolutionFilter(5, 5, matrixArr); shape_mc.filters = [convolution]; var mouseListener:Object = new Object(); mouseListener.onMouseMove = function():Void { convolution.divisor = (_xmouse / Stage.width) * 271; convolution.bias = (_ymouse / Stage.height) * 100; shape_mc.filters = [convolution]; }; Mouse.addListener(mouseListener);

이미지 왜곡필터

import flash.filters.DisplacementMapFilter; import flash.geom.Point; import flash.display.BitmapData; var perlinBmp:BitmapData; var displacementMap:DisplacementMapFilter; var mclListener:Object = new Object(); mclListener.onLoadInit = function(target_mc:MovieClip):Void { target_mc._x = (Stage.width - target_mc._width) / 2; target_mc._y = (Stage.height - target_mc._height) / 2; perlinBmp = new BitmapData(target_mc._width, target_mc._height); perlinBmp.perlinNoise(target_mc._width, target_mc._height, 10, Math.round(Math.random() * 100000), false, true, 1, false); displacementMap = new DisplacementMapFilter(perlinBmp, new Point(0, 0), 1, 1, 100, 100, "color"); shapeClip.filters = [displacementMap]; }; var shapeClip:MovieClip = this.createEmptyMovieClip("shapeClip", 1); shapeClip.createEmptyMovieClip("holderClip", 1); var imageLoader:MovieClipLoader = new MovieClipLoader(); imageLoader.addListener(mclListener); imageLoader.loadCl...

이미지에 노이즈효과

import flash.display.BitmapData; this.createTextField("status_txt", 90, 0, 0, 100, 20); status_txt.selectable = false; status_txt.background = 0xFFFFFF; status_txt.autoSize = "left"; function onMouseMove() { status_txt._x = _xmouse; status_txt._y = _ymouse-20; updateAfterEvent(); } this.createEmptyMovieClip("img_mc", 10); img_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg"); var noiseBmp:BitmapData = new BitmapData(Stage.width, Stage.height, true); this.attachBitmap(noiseBmp, 20); setInterval(updateNoise, 100); var grayScale:Boolean = true; function updateNoise():Void { var low:Number = 30 * _xmouse / Stage.width; var high:Number = 200 * _ymouse / Stage.height; status_txt.text = "low:" + Math.round(low) + ", high:" + Math.round(high); noiseBmp.noise(Math.round(Math.random() * 100000), low, high, 8, true); }

이미지 흐리게 하기

import flash.filters.BlurFilter; import mx.transitions.Tween; import mx.transitions.easing.*; this.createEmptyMovieClip("holder_mc", 10); holder_mc.createEmptyMovieClip("img_mc", 20); var mclListener:Object = new Object(); mclListener.onLoadInit = function(target_mc:MovieClip) { target_mc._x = (Stage.width - target_mc._width) / 2; target_mc._y = (Stage.height - target_mc._height) / 2; var myTween:Tween = new Tween(target_mc, "blur", Strong.easeInOut, 0, 20, 3, true); myTween.onMotionChanged = function() { target_mc._parent.filters = [new BlurFilter(target_mc.blur, target_mc.blur, 1)]; }; myTween.onMotionFinished = function() { myTween.yoyo(); } }; var my_mcl:MovieClipLoader = new MovieClipLoader(); my_mcl.addListener(mclListener); my_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", holder_mc.img_mc);

table

1 1 1 1 table style="BORDER-COLLAPSE: collapse" bordercolor="#3e3e3e" cellspacing="0" cellpadding="3" rules="rows" width="500" border="2" frame="hsides"