The Top 5 Reasons to upgrade to CS5

So since the unveiling of CS5 last week I have been doing a little research and have come up with the top five reasons to upgrade to Adobe CS5.

  1. CS5 now includes Flash Builder (formally Flex Builder)
  2. You can now create a Flash project that can be coded in Flash Builder
  3. You can use Flash to create apps for the iPhone and iPad
  4. Content Aware Fill in Photoshop
  5. Content Aware Fill in Photoshop

If you haven’t seen Content Aware Fill in Photoshop CS5 you need to. Go to John Nack’s blog and check it out. Here is a link: http://blogs.adobe.com/jnack/2010/03/caf_in_ps.html

Flash Builder 4 Install Error

So I attempted to install the new Flash Builder 4 the other day and got this error:

Exit Code: 7

————————————– Summary ————————————–

– 0 fatal error(s), 3 error(s), 0 warning(s)

ERROR: Custom Action for payload {177E1CA1-14CC-4398-AB15-A5746EFE8F22} Adobe Flash Builder returned error. Failing this payload.

ERROR: The following payload errors were found during install:

ERROR:  – Adobe Flash Builder: Install failed

————————————————————————————-

00-37641-141726032010

I am running a 64 bit version of Windows 7 that easily met the requirements so it was throwing me for a loop. After looking at the install log file a good friend of mine noticed that my windows user name had a special character in it (the ‘&’) and suggested that I make a new admin user without any special characters in the name. I did that and it worked. If you run into this error and are banging your head against the wall check your user name. Thanks again Josh for the find! You can check out Josh’s blog by clicking the link I have to it on my blog.

How to format a number as money

Recently I was working on a project where I had to take a number that represented a monetary value and display it as money. For example say I had a numeric variable that contained the value of 10000 and I needed it to display like money with the commas and dollar sign like this $10,000. So in other words I needed the string representation. That is what this simple function that I am posting does. I have written it here in Flash ActionScript 3 as a static function of a class, but you could adapt it however you need to. Here is the code:

public class Formatter
{
    public static function formatMoney(val:int):String
    {
        var isNegative:Boolean = false;
        var moneyVal:String = val.toString();
        var len:uint;
        if(val < 0)
        {
             isNegative = true;
             moneyVal = moneyVal.replace(/-/, "");
        }
        len = moneyVal.length;
        for(var i:int=len; i>0; i-=3)
        {
            if(i == len)
            {
                continue;
            }
            var firstHalf:String = moneyVal.substring(0, i);
            var lastHalf:String = moneyVal.substring(i);
            moneyVal = firstHalf+","+lastHalf;
        }
        if(isNegative)
        {
            return"$-"+moneyVal;
        }
        return "$"+moneyVal;
    }
}

Latest Project – Rotating Flash Banner

I just recently did a freelance project for makeityourweb.com It is a rotating banner. It is populated by XML. The XML file lets you control what images are loaded along with the time each image is up and also whether or not it has the navigation in the lower left corner. It’s pretty cool! Go check it out at http://www.kttape.com/

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.

If you have ever received this error it can be quite frustrating and there are a lot of not so helpful answers out there on the web. Because of that I wanted to post this real simple solution. All you need to do is add an event listener to the item calling the URLRequest. Here is a simple example using a Sound object:

var audio:Sound = new Sound();
audio.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);
audio.load(new URLRequest("myfile"));

function handleIOError(evt:IOErrorEvent):void
{
//handle error if needed
}

It’s that simple. I hope this helped! If this helped please post a comment so that others can find this simple solution.

Adobe MAX 2009

So this last week was MAX and the bummer news for me is that I didn’t get to go this year. On a good note though they put up a bunch of cool stuff online. If you didn’t get to go either or are new to what MAX is go check it out at http://max.adobe.com/online/ Monday’s keynote was awesome! They announced some way cool things for the next release of Flash. The biggest announcement was that Flash CS5 will enable developers to develop Apple Apps in Flash and then compile them down as native apps that can run on the iPhone and iPod touch. Pretty dang sweet! Another cool thing they announced is that finally the code editor in Flash will have custom class introspection and Flash Builder (new name for Flex Builder) has a new Flash project. This allows you to edit a document class in Flash Builder and then compile and run from Flash Builder. To see more on these features watch the free session from Monday, October 5, 2009 entitled Secret Session: Flash Professional. MAX is awesome and I am looking forward to going next year. They also announced that later this month they will be putting up all of the sessions so that we that couldn’t go can check them out. One last cool announcement was that they will be doing a public beta for Flash CS5. To go sign up to be notified for that go to http://labs.adobe.com/ All and all some pretty cool stuff.

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”