AS3 Regexp

One think that I am really thankful is the addition of Regular Expression in AS3.
That’s really helping me around.

Here’s some cheatsheets that I always check:
http://krijnhoetmer.nl/stuff/regex/cheat-sheet/
http://regexlib.com/CheatSheet.aspx
http://www.ilovejackdaniels.com/cheat-sheets/regular-expressions-cheat-sheet/

Also, I uploaded my svn my StringUtils class
http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/StringUtils.as

Actually, there’s just the trim method, but you see that’s it’s really easier than AS2.
\s|\n|\r|\t|\v <- I put all those characters to make sure every initial end final whitespace are trimmed.

Also, I uploaded my ColorUtils.as too.
You see that it's really easy to manage ARGB colors with it.
Also, there's a RGB -> Grayscale color converter.

Oh, don’t try converting a bitmapData pixel by pixel to generate a Grayscale image.
There’s an easier way to make it with the BitmapData.paletteMap() method.
but… I’ll keep it to the next post …. if anyone shows any interest.

2 Comments »

  1. ck said,

    January 14, 2008 @ 8:07 pm

    … you mentioned to use BitmapData.paletteMap() to generate a grayscale image. Until now I didn’t get this working. How did you do that?

  2. Stacy said,

    April 11, 2008 @ 3:23 pm

    After working all day I visited this website and guess what? I sound this source and I don’t feel tired any more! It’s the best entertaining source!

RSS feed for comments on this post · TrackBack URI

Leave a Comment