Eraser Text Effect

In: Actionscript|Experiments|Flash|Source Code

16 May 2009

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"]

Get Adobe Flash player

[/kml_flashembed]
And here’s some un-optimised, uncommented code -

?View Code ACTIONSCRIPT3
//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.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Tumblr
  • Twitter

Comment Form

About this blog

This is the blog of Lawrie Cape, an interactive developer from Leeds, England.

Photostream

  • COne
  • CTwo
  • CThree
  • CFour
  • Lawrie: Hi Dinaz, I'm not sure what's happening on your system I'm afraid. When you run the FlashMidiServer [...]
  • Dinaz Kardooni: Hi, I am having trouble with the Flash Midi Server. I downloaded it and it says it is connected, but [...]
  • It’s Movember again! - The Lawrie Cape Blog: [...] was a great project to work on and I wrote a blog post about it here. We had a nice surprise t [...]
  • Lawrie: Glad you got it working :) [...]
  • Anonymous: Yeah, had to do this first: var mc:MovieClip = MovieClip(this.parent); trace(map(mc.mouseY, 0, s [...]

Donate

Found any helpful code? Why not donate a quid or two. Cheers!