AIR, Flex / Flash, FMS, PushButton, Game… Developer
Archive for January, 2009
Tip of the Day – Using the libs directory in Flex Builder
Jan 11th
This tip I’m stealing from Amy over on the flexcoders list.
One not so well documented feature of Flex Builder is the use of the libs directory. By default, when you create a new Flex Project, a libs directory is created. So say for example, you want to create a project, and you are planning to use the Cairngorm framework.
All you need to do is copy Cairngorm.swc into your libs directory, and you’re good to go.

Theme change
Jan 10th
Although I loved the elegant-grunge theme… I find that this theme is just so much easier to read.
Tip of the Day – Mouse wheel scrolling on the mac
Jan 10th
A friend of mine asked me yesterday if I would take a look at a Flex application that he was writing. I said, “of course!”, and pulled up his app in my browser. To my surprise, I couldn’t for the life of me figure out how to navigate through his application.
So I called him back as asked him. He told me that his app uses the mouse wheel quite a bit to navigate around, he thought it would be very intuitive. I guess not everyone knows that mouse wheel scroll events don’t register on the mac.
So today I’m letting everyone within the sound of my blog know that…
Mouse wheel scrolling does not work on Macs… natively!
Luckily for us, Ali Rantakari has created a solution for this very problem. You can read up about the solution in this post.
ColdFusion – Let’s be honest here
Jan 9th
This morning when I woke up and opened up Google reader, I ran across this post by Aral Balkan. Nothing sparks an argument more than telling a group of developers that they’re platform is headed the way of Davy Jones locker.
After reading his post, and then the comments. I really started thinking about where ColdFusion fits into my development career today.
I started programming in ColdFusion back in 2003, using version 6.0. For a long time ColdFusion has been my language of choice. I’ve developed applications for quite a few companies using ColdFusion including Knight Transportation and Boeing.
Don’t get me wrong, I love ColdFusion! But recently I’ve found myself opting for other server side language options, particularly Ruby and PHP.
Hosting a ColdFusion project requires a significant investment, whether you are purchasing a ColdFusion license or using a hosting provider. I was paying for a ColdFusion VPS over at HostMySite.com. Which I unfortunately had to get rid of due to HostMySite’s inability to keep my server running.
I then learned that there aren’t really a lot of quality ColdFusion hosting options available out there. Which means that if I want to deploy a ColdFusion site, I pretty much need to put my own servers up somewhere, in addition to purchasing a ColdFusion license.
What I think Adobe should consider doing is setting up a licensing tier much like they did with Flex. Back when Flex was in it’s infancy, it was packaged as a single server product, with a price tag around $15,000 per CPU. Flex’s adoption of version 1 and 1.5 was very poor. It wasn’t until Adobe started giving away the Flex SDK did developers really get on board with it.
So why not do the same thing with ColdFusion? Heck, there is already a watered down version of LiveCycle which Adobe has open sourced, BlazeDS. Why not give us an open source server solution for ColdFusion?
There is no doubt in my mind that ColdFusion is still alive and kicking. It screams to be used within corporate environments, and it’s integration with Flash / Flex is second to none. But outside of the enterprise / corporate market, I don’t see much use for it anymore unless they changed how it is licensed.
Tip of the Day – Proxies… Make ‘em dynamic
Jan 9th
A couple of days ago, I was working on my DateTime proxy class.
DateTime.as (Trimmed version)
package net.natebeck.core { import com.flexoop.utilities.dateutils.DaylightSavingTimeUS; import flash.utils.Proxy; import flash.utils.flash_proxy; public class DateTime extends Proxy { // Instance Variables protected var _date:Date; protected var _timezone:Timezone; public function DateTime(... args) { super(); _date = new Date(args[0]); if(args[0] is String) setTimezone(parseTimezone(args[0])); } public function setTimezone(value:Timezone):void { trace("Setting Timezone: "+value); _timezone = value; } public function getTimezone():Timezone { trace("Getting Timezone: "+_timezone); return _timezone; } public function getTimezoneOffset():Number { return _timezone.offset; } override flash_proxy function callProperty(methodName:*, ... args):* { var res:*; switch (methodName.toString()) { case 'toString': res = "foobar"; break; default: res = _date[methodName].apply(_date, args); break; } return res; } override flash_proxy function getProperty(name:*):* { trace("getting property: "+name); return _date[name]; } override flash_proxy function setProperty(name:*, value:*):void { _date[name] = value; } } }
I wrote a simple test application to test my DateTime Proxy class while I’m developing.
TestDateTime.as
package { import flash.display.Sprite; import net.natebeck.core.DateTime; import net.natebeck.core.Timezone; public class TestDateTime extends Sprite { public function TestDateTime() { var create:Object = "Jun 17 12:00:00 GMT-0500 2009"; var oldDate:Date = new Date(create); var strDate:DateTime = new DateTime(create); trace("old: "+oldDate); trace("new: "+strDate); strDate.getTimezone(); strDate.setTimezone(Timezone.PST); strDate.getTimezone(); trace(strDate.toString()); } } }
When trying to compile using Flex Builder I ran into this error:
ERROR 1061: Call to a possibly undefined method toString through a reference with static type net.natebeck.core:DateTime.
I thought to myself, “Well that’s lame… the whole reason I’m using the Proxy class is so I don’t have to re-write every method within my class”.
As usual, the issue wasn’t with the compiler, it was me being dumb. Computers… they’re always right.
The answer was simple, and makes complete sense after someone mentioned it.
When creating your own Proxy class, make them dynamic!
public dynamic class DateTime extends Proxy
If you’re confused about when or why to use the flash.utils.Proxy class, I gave a presentation yesterday at the Seattle Flex User Group about the Proxy class. My presentation materials are posted here.
I’d also like to thank Dale and Josh McDonald for quickly responding to my question on flexcoders.
Presenting about Proxies to the SeaFlex User Group
Jan 8th
So I got a call yesterday from Marty informing me that the presenter for the SeaFlex User Group has gotten sick, and need a presenter.
So… being the super nice guy that I am… I said that I would present.
So tonight I will presenting on the topic of the flash.utils.Proxy class. More information can be found on the SeaFlex User Group.
Hope to see you there!
:: UPDATE ::
My presentation is available at natebeck.net/talks.