AIR, Flex / Flash, FMS, PushButton, Game… Developer
Actionscript
Tip of the Day – Flex Builder, Open Resource shortcut
Jan 13th
So while thinking about the tip I wanted to write today… I thought about my development process, and trying to identify things that I do to speed up my development. That way I can share them with all of you.
One thing that has become second nature to me is the use of the Open Resource shortcut in Eclipse (and therefore Flex Builder). This handy little shortcut is a life saver.
For all the pcs: ctrl + shift + R
For all the macs: ⌘ + shift + R

This panel allows you the type in the resource you want to open, even if it is open already, and will bring it to focus. It’s amazing! Use it, love it, cherish it.
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.
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.
Tip of the Day – Flex Date Utils
Jan 8th
I’ve recently been working with Gareth over at flexoop.com. He has been creating a more feature rich Date utility class.
As he puts it, “FlexDateUtils expands the Flex date library to be more on par with the date libraries found in many other programming languages. Most of the methods were adopted from ColdFusion as those are very full featured.”
Gareth has done a great job putting this library together.
Check out the project on RIAForge.
There are also in depth explanations on how to use the library on flexoop.com.