Flash, Actionscript, Design, Games and Programming.
A few weeks ago, I watched the Schwarzenegger classic – Eraser. It’s not one of the best Arnie films, but I liked a text effect they used on the opening credits. The cast’s names were written in, then blurred vertically, as they were split into two copies, and panned left and right.
So I went home and thought about recreating the effect in flash. Here’s my first set of results, the opening titles for Eraser 2.
[kml_flashembed fversion="9.0.0" movie="flash-content/eraser/Eraser.swf" targetclass="flashmovie" publishmethod="static" width="450" height="100"]
[/kml_flashembed]
And here’s some un-optimised, uncommented code -
//Eraser style blur effect - NB. Clip must be centred top left. var generations:int = 100; var generationsCounter:int = 0; function eraserEffect(clip):void { var bf:BlurFilter = new BlurFilter(2, 25, 1); var bmd1:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0x00CCCCCC); var bm1:Bitmap = new Bitmap(bmd1,"auto",true); var bmd2:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0x00CCCCCC); var bm2:Bitmap = new Bitmap(bmd1,"auto",true); var baseX = clip.x; var baseY = clip.y; bm1.x = bm2.x = baseX; bm1.y = bm2.y = baseY; bmd1.draw(clip); bmd2.draw(clip); addChild(bm1); addChild(bm2); stage.addEventListener(Event.ENTER_FRAME, blurThem); clip.visible = false; function blurThem(e:Event):void { bmd1.applyFilter(bmd1, bmd1.rect, new Point(0,0), bf); bmd2.applyFilter(bmd2, bmd2.rect, new Point(0,0), bf); bm1.x+=2; bm2.x-=2; generationsCounter++; if (generationsCounter>generations) { generationsCounter = 0; stage.removeEventListener(Event.ENTER_FRAME, blurThem); bmd1 = null; bmd2 = null; bm1.parent.removeChild(bm1); bm2.parent.removeChild(bm2); } } } eraserEffect(YourClipHere); |
Cheers.
Lawrie.
Update – I found a youTube video of the opening credits, and it seems I didn’t remember them exactly. There’s not half as much Y blur on the real ones, but a pretty good quick try of the effect I think.
PS – If you’re wondering, the font is Technetium from the great Divide By Zero.
This is the blog of Lawrie Cape, an interactive developer from Leeds, England.