Monthly Archives: February 2006

Computer Science Concepts in Actionscript

Actionscript isn’t exactly the language of choice among computer scientists. However, some of us who went through the algorithm-packed curriculum of the computer science major have somehow found ourselves enjoying Flash and it’s language. I believe there are a pretty decent number of artistically-inclined programmers out there with a creative side.

After seeing a bunch of sorting functions implemented in Actionscript today (you’ll see that in the list below), I took some time looking for some other concepts I studied in college. There’s something inherently interesting about seeing this stuff done in Actionscript. I’m not sure why. Maybe it’s because we’re not dealing with a hardcore language.

I spent several years diving head first into data structures, assembly language, finite state machines, and all sorts of interesting concepts like those. I tended to make it through some of the tough stuff by the seat of my pants. Sometimes I wish I had spent more time really getting to know some of these concepts better. Honestly, though, who’s gonna pass up all-night LAN parties and awesome house parties every weekend? Not me. Plus, I think I’ll enjoy this stuff more now that I’m learning it by choice rather than for the next exam.

AIM in Flash… Again!

Update: This project has been updated for the official release of the free Flex 2 SDK.

That’s right, ladies and gentlemen. Today, I bring you the second release of my Flash-based client for AOL Instant Messenger. Since Adobe released Flex Builder Beta 1 a short while ago, I needed to change the project to work in the updated environment. Of course, I couldn’t leave it as-is, so I took some time to add a little more (much-needed) functionality.

Flash Actionscript 3 AIM Release 2

I spent some time adding text-formatting. You can change the font size, color, and styling. The client can also handle formatting sent with messages from buddies. It’s all basic HTML, so the Flex components didn’t have too much trouble handling it. I just had to make a few tweaks, since AOL messages have weird font sizes (or is it Flex?).

I also added the ability to view buddy info, and I the client now connects to an AOL server that supports profiles. These are stored on the server in html, except it’s nowhere near standards-compliant. I had to do some extra parsing on what AOL sent my way to get Flex to like it.

Remember, you need the latest Flex Builder 2 Beta 1 and the pre-release 8.5 Flash player to try out the demo. If you aren’t a Flash/Flex programmer, you probably don’t have these. You’ve been warned. Now, head over to the downloads, and try it out.

Developing Simultaneously for AS2 and AS3

I recently worked on a project for IFBIN where I created the same example in both AS2 and AS3. It’s an interesting experience, and I wanted to get my thoughts down about it.

  1. Build everything in AS3 first. It’s a stricter language, and if you’re anything like me, if start out in AS2, you’ll probably take a few shortcuts. You’ll pay once you get to the AS3 version. In my case, I found it more important to write good code because it’s is going to be viewed by a lot of people.

  2. You’ll hit some problems if you’re using components. Obviously, the components in Flash 8 and Flex 2 aren’t the same. DataProviders for Lists and DataGrids don’t work in quite the same way (Array for Flash 8 versus ArrayCollection in Flex 2). Likewise, text components don’t always work the same in regards to HTML.

  3. AS2 events suck. Built-in classes like XML don’t really dispatch events, and events in components need things like Delegate. Whether you start with AS2 or AS3, if you use any native events, you’re going to have to rewrite some code.

  4. AS3 uses the lowercase void instead of the uppercase Void

  5. For-loops in AS3 should use the new integer type int instead of Number. It’s not required, but a good best practice.

  6. XML is handled differently. In AS3, you’ll probably want to use the new E4X. If you’re interested, AS3 provides a legacy class to match the XML class in AS2.

A lot of classes moved around too. Check out the AS2 to AS3 migration guide for complete details. Can anyone think of other differences that someone should consider when developing for both platforms?

Why Web 2.0 is more like 1.5

If a web site contains asynchronous calls or doesn’t work like a regular webpage in some way, it’s being labeled with the notorious Web 2.0 tag. Regardless of my feelings about the hype surrounding it, I believe that we’re actually seeing a preview or teaser of what we’ll really consider a second version of the web. Why? Because we still do everything in a web(page) browser.
Continue reading

Changing Flash's image among the tech crowd.

As anyone who has read Slashdot knows, mentioning Flash is a good way to get people angry. Among the ultra-devout tech crowd, Flash has one of the worst stigmas imaginable. When I read comments on Slashdot, and even on Digg, I want to scream at the closed-mindedness. These people slammed the doors shut years ago, and they would like Flash to die a horrible death and disappear.

It’s funny really. There’s nothing inherently bad about the Flash platform. It offers a pretty decent language (which is getting even better with AS3), scalable vector graphics, and it’s on almost every computer out there. Yet like Java, Flash gained a reputation early on, and it’s tough to make people take a fresh look at it. Early implementations of Java offered poor performance, but now, those issues have virtually disappeared. Even today, many still argue that Java is horribly slow when many studies have shown that it’s nearly comparable to native C code. Likewise, Flash gained a reputation for bringing us obnoxious advertisements that can ruin the web browsing experience. In the same vein as popup-blockers, tools exist to block Flash content.

However, Flash is branching out into many new realms that take it well beyond web advertisement. The upcoming Flex Builder 2 will be an amazing tool to build Rich Internet Applications. Some call it an AJAX killer, many admit that it’s a strong potential competitor, and yet I’m seeing many techies completely ignoring it because it’s based on Flash. Honestly, it’s frustrating. Flash, like any technology, can be used for good or bad. I’ll admit, I hate most Flash ads with a passion as much as the next guy, but as a developer, I’ve chosen to make Flash a part of my daily life.

Share your thoughts. What do you think would help the most to change a few minds among the tech crowd? I know there are many folks out there who will never look at Flash with respect, but I’d say there are just as many that only need a fresh look to see what Flash has to offer.

Opera's Small Screen Mode is Awesome!

I recently downloaded the Opera Web Browser so that I could use it for testing some pages I’m working on. Did you know it’s totally ad-free now (and doesn’t cost a penny)? Me either. Anyway, as I was playing around with its weird interface, I discovered “Small Screen” mode in the View menu. Suddenly, the site I was viewing squished to about 300 pixels wide, and a bunch of styling information was lost. “Odd,” I thought to myself. Then I quickly realized that I was looking at the page as someone with a mobile device might see it.

While I don’t often target mobile audiences, I can instantly understand the usefulness of this feature. For some quick testing during development, Small Screen mode would help a lot because you won’t necessarily have to reload a page in a phone’s browser every time you make a change. Imagine if you had some sort of page saved locally for an application on the phone. You’d have to transfer your files every time you want to test them, and I don’t doubt that would become a hassle.

That’s not the main reason I’m excited about it, though. I intend to test every website I build from now with this feature. Why? Because it gives me an example of how a particular site will react when it should be failing gracefully. For every bell and whistle I include, I try my best to provide an alternative, and this will do wonders to help me test that it’s all working.

Think that’s cool? You might also be interested in the Web Developer Extension for Firefox, which provides all sorts of interesting (and more advanced) options for viewing a page.

Time to Target Flash 8?

Many wisely chose to wait before putting Flash 8 content on the web. For a business, blocking a large portion of your customer base is a bad idea. As I’m sure you’ve read, Adobe recently released their first Flash Player 8 version penetration data. Now, 8-ball sits on about 50% of machines out there. The question on my mind is, are we at a point where a company could reasonably take advantage of new features of Flash 8?

Assuming that it takes a bit of time to develop the content, would it be safe to assume that penetration would be strong enough by the time a project is ready to deploy? Obviously, different projects have different target audience requirements, so don’t worry too much about the details. One thing to consider is that web advertisers are starting to switch to Flash 8 content. People may not like ads all the much, but if the ads don’t look right because Flash Player 7 doesn’t render them correctly, many will upgrade quicker (as odd as that sounds). Likewise, I’m sure Flash Player is still sending out the new upgrade notifications. Discuss.