Regular Expression for email validation

Had the need to validate an email address in Actionscript 3 recently. I have always copied and pasted regular expressions before.  I took the time and learned them (the as3 implementation anyway). Below is a function using an email validation regex and an example swf along with the source.

function isValidEmail( str:String ):Boolean {
                  var emailExp:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
        return emailExp.test( str );
      }

regextest

Desaturate/greyscale a movieclip in As3

I recently needed to have a movieclip go black and white on rollover. ColorMatrix to the rescue. Below is a function which will desaturate a passed DisplayObject.

desaturate(clip);
 
// convert passed clip to greyscale
function desaturate(obj:DisplayObject)
{
	var r:Number=0.212671;
	var g:Number=0.715160;
	var b:Number=0.072169;
 
	var matrix:Array = [r, g, b, 0, 0,
                                      r, g, b, 0, 0,
                                      r, g, b, 0, 0,
                                      0, 0, 0, 1, 0];
	obj.filters = [new ColorMatrixFilter(matrix)];
}

Download example FLA

Ever wonder if your PC can run the latest game?

http://www.systemrequirementslab.com/referrer/srtest

Can you run it? A sweet site (well java component) that lets you determine if you can run the latest games on your PC.

Get around Flash security sandbox

http://nocrossdomain.com/

A site to get around the secrurity sandbox model of flash. Want to load content from wherever you want? Try this (as long as they are around).

Amusing online forms

http://www.bureauofcommunication.com/

Official forms online for various occasions and events. My favorite is the “Airing of Grievance” form.

grievance form

Nifty backup program for windows

http://www.karenware.com/powertools/ptreplicator.asp

Karen’s Replicator is a powerful if bricky backup program for windows. The interface is a little old school, but the feature set is quite nice.

Screenshot

Great free windows shooter games

The shooters from ABA games, bring back retro gaming nirvana. Sytlized graphics, techno soundtracks, and zen trance inducing gameplay.

Get them at ABA

Reinstall Windows and outfit your system with all freeware programs

This is something I’ll have to remember next time I “re-do” a relative’s computer. Not so much the freeware progams bit, but the method mentioned for creating a drive image for restoring to a fresh install later.

Great site with some nice freeware apps for windows.

Check it out at freewaregenius.com

Portal in Flash

Portal flash game screenshot

http://portal.wecreatestuff.com/portal.php

Great site to help you use the web and your computer

http://www.makeuseof.com/ is a fabulous site with tips on free software for your pc or mac. The site also posts regular collections of useful web pages and tools. Its about the best site I’ve seen of this nature.