Email Validator for Flash

Okay so far I have not been very consistent on this blogging thing. I have been really busy lately. I plan on posting more often. I have been working a lot in Flex (Flash Builder 4 Beta). The other day I was building a form and took a look at the EmailValidator class in the Flex Framework. The class is pretty sweet and appears to be pretty robust. Sometimes that is exactly what you want, however sometimes you just want a super simple, easy-to-use email validation method. Because of that need I wrote a really simple email validation class. It is really simple and basically just checks for an ‘@’ symbol and a ‘.’ character, but it is really easy to implement. It’s not like the other email validators actually validate the email anyway. They may be more complex, but it’s not like they actual validate it by sending an email. So anyway I have included the source code to this class and if you are looking for an easy way to validate an email feel free to use it and adapt it as your heart desires. It is written in ActionScript 3.0, but it would be really easy to convert it to AS 2.0 if for some reason you were programing in that. Here is what the code looks like:

package
{
    public class EmailValidator
    {
        public static function validateEmail(emailAddress:String):Boolean
        {
            var testsPassed:uint = 0;
            if(emailAddress.indexOf('@') > 0)
                testsPassed++;
            if(emailAddress.lastIndexOf('.') > emailAddress.indexOf('@'))
                testsPassed++;
            if(testsPassed == 2)
                return true; else return false;
        }
    }
}

Here is a link to the source files: Email Validator The .fla file was saved in Flash CS4 so to open it you would need that version or later. Continue reading “Email Validator for Flash”

What I’ve been doing

A quick catch-up

Okay, so it has been a while since my last post. So what have I been doing? Definitely not blogging! I hope to do better in the future. I still have yet to get my site up and running. It is still the same old one page, but I have been working on some other sites. The one that I have put the most work into is www.ldssacredsongs.com I have done quite a bit of work for this one. I designed the look and layout as well as programmed the entire site. It has a pretty cool MP3 player all done in Flash and a new widget that I just added also done in Flash. I am planning to do some video tutorials here in the next little while and might demonstrate how I did some of these items. If you see something on this site or any of the others that I discuss on my blog and would like more info on them please feel free to leave a comment. I love getting people addicted to Flash! Another website that I did the design for recently is www.visuallinklanguages.com This site is for the a company that I work for. Web design and Flash are two of my favorite things! Well that is it for now. I need to get some sleep.

Hey y’all

Hello world, my name is Joe (Joseph) Billman I am a computer programmer/graphic designer. I do a lot of work with Adobe Flash both in programming and design. Because of this I plan on blogging about cool things in Flash, but that is not all. I have been using Flash since 2004 and flat out love it. If you happened to stumble onto this blog and you also love Flash I hope that you will find something useful. I am really looking forward to sharing some really cool stuff and reading your comments. Until the next blog.