Hacking the Flex SDK

Jacob Wright
March 3rd, 2008

The Flex SDK is finally fully open-source. So I thought I’d have a little fun and implement my own Binding classes to be used when using the [Bindable] metadata tag in an ActionScript 3 project.

The first thing I did of course was to checkout the Flex SDK from subversion. They’ve got instructions on doing all that in their wiki. The wiki also has some great instructions for downloading and installing ANT and the other things you’ll need to build the SDK. Look further down on the previously linked to page in the section “Building and testing.”

Once I had the project checked out I downloaded ANT per the Mac-specific instructions on the wiki. I the ran `source setup.sh` and then `ant -q main` just like they said and voila! I had built my own SDK. Of course, it was basically the same as the one already installed with Flex Builder.

I then started digging into the code and found in the sdk/modules/compiler/src/java/flex2/compiler/as3/binding/BindableProperty.vm template file that is used for the auto-generated binding code. I took out some of the imports, changed the [Bindable(event="propertyChange")] on line 62 to [Bindable(event="${entry.propertyName}Change")], and changed every place it had dispatchEvent(PropertyCha…. to dispatchEvent(new Event(”${entry.propertyName}Change”). This will allow my binding class that just looks for {propertyName}”Change” event for binding instead of using the expensive describeType function.

Next, I compiled the whole SDK and had issues, because the Flex framework needs to use the old binding. SO DON’T DO THAT. After backtracking and fixing things up I changed to the sdk/modules/compiler/ directory and THEN ran `ant -q main`. Now my mxmlc will use the new binding template but the old framework SWCs weren’t compiled wrong with it.

To check out the new generated classes compile your project using `mxmlc Main.as -keep`. That creates a folder called “generated” that has all those classes including your new bindable changes in it. Now in Flex Builder, you can add a your new SDK and compile your own projects. Haven’t had time to actually test this out yet and I’ve gotta run, but let me know if you get it working.

AIR Project Tracker (timer, task-list)

Jacob Wright
January 12th, 2008

I wrote a project timer awhile ago. After I had done that (in Flash 8) I needed a task list that could be split up by client and project, so I combined the old time and a new task list into what I called creatively the Project Tracker. I’ve been using it since Apollo preview release. I just added a new feature for myself that rounds the times to the nearest half-hour or hour if desired (since that’s how my company bills clients), and I thought that I’d share it. It allows you to keep track of time spent on tasks, project, and clients as well as let’s you check off any of them when complete. You can also store notes about each of them.

It doesn’t use any AIR specific features, just SharedObject, but I sure like to have it as a desktop application rather than in the browser. I always close browser versions on accident.

This application is provided as-is with no documentation, support, or guarantee of anything. Hope you find it useful. You can view Project Tracker in your web browser before you download it.

Update: Republished for the AIR 1.0 release and updated badge install.
Update 2: Found and fixed the problem reported in comments. Using a relative path in the badge installer for AIR apps results in some of the errors reported.



This application requires the following be installed:

  1. Adobe® AIR™ Runtime
  2. Project Tracker

Please click on each link in the order above to complete the installation process.

Idea for an AIR App

Jacob Wright
January 10th, 2008

I’m working on a library to give rich text or WYSIWYG functionality to an AIR HTMLLoader. It’s coming along nicely thus far. I have all the keyboard shortcuts happening and the HTML is being replaced by the appropriate stuff (e.g. bold fixes webkit’s <span class=”Apple-blah blah” style=”font-weight: bold”> to just <b>). I’ve got undo/redo in place even with typing and deleting etc.

So I was thinking, it would be cool to write a DocBook editor in AIR. It might be the first DocBook authoring tool that looked nice. :) DocBook is an XML format for books or documentation. I won’t go into why it’s so great, but you can check it out yourself.

Seeking Perfection

Jacob Wright
May 15th, 2006

I find myself always seeking for the perfect code, the perfect library, the perfect system. Is it healthy? My employer might rather a code monkey which will mass produce web applications. Sure, the code would be a pain to maintain, but we would make more money. Or would we?

I was contracted by my company for awhile to one of their clients. While I was there I started making my own JavaScript tree menu in my spare time. The developers I worked with asked why I would do something like that. There are already a handful of tree menus free for download on the web. I was doing it because, one, I thought it would be fun (they thought I was crazy), and two, none of the tree menus gave the functionality I sought. I ended up making a tree menu that is really nice, has a context menu, and works well with Ajax. I have used it in several projects.

I also started building a PHP framework around that time. Pherret was created in my spare time (another “painful” project my coworkers said) because I thought it would be fun and because I didn’t like what was already out there? Arras Template, which became part of Pherret, is a unique and fun templating system. And finally I put together my own JavaScript Ajax library, borrowing some from others like Prototype.

Not being content to use others’ code, others’ frameworks, and others’ hard work is my downfall.

Or is it? I am now the expert at my company in JavaScript. I know the inner workings of what a framework needs to deal with. I know what a template system needs to be able to do, and some of how to do it. I have gone from knowing very little about programming (just 2 years ago) to being a well-versed and well-rounded developer. The drive that has me writing things that have already been done, or even just the drive that has me developing in my spare time instead of just in the workplace is what has made me valuable as a developer. I suppose we call the type a “hacker”. The person who loves to get their hands into code as a hobby.

I’m glad I’m a hacker. I program in a way that my code becomes better and better, day after day. My applications become better layed out. Better organized. Easier to maintain.

MyStickies Goes Live

Jacob Wright
January 19th, 2006

Finally, after months of work (part-time) MyStickies is live. What is MyStickies? Sticky notes for the web, and much more.

MyStickies is a javascript script that can draw notes on web pages and tag them. The notes are saved to an online account and whenever you come back to the page, the notes will load back up.

The account you create on MyStickies.com is also great because you can manage your notes from there. You can see what your most recent notes are. You can view them by domain, or by tag. You can even open them right there to view and/or edit their content.

MyStickies Account Area

To get started you can go to http://www.mystickies.com/ and signup for an account. To test out the sticky process just press the “Try Me” button on the home page and you’ll get a note. You can also press Alt+Click+Drag to create notes, and if you press Alt+Click on the header of the note you can toggle between colors if you would like your note in green, blue, or gray instead.
There are two ways to get that javascript onto your page so you can place notes and see the ones you’ve placed. Those are through a browser extension (Firefox it currently supported with others soon to follow) and through a bookmarklet. The extension makes it so you always have your notes there automatically. The bookmarklet will need to be clicked on every page you want to see or place your notes.

If you go the extension route (recommended), make sure you log back into your account after installing the extension so that the account can register with your extension.

Now you know why I haven’t posted much for awhile. I still intend to get to the ecommerce tutorial eventually. And write more in the future, but we’ll see how much time I have after MyStickies. We still have many more features in store.

We hope to be able to get people linked up with their friends soon. Then they can share a tag of notes with a friend. After that we will be introducing public notes which after being made public anyone can modify (or delete). We’re not sure how that will go over, but no one was sure if wikis would work our when they first came along. We’ll leave the rest of our plans a mystery for now so you can still have some suprises later.

MyStickies is a free service and we will keep it free. However, it costs a lot of money for us to keep it up, and there are several ways in which we could fund it to pay for servers, bandwidth, etc. The most attractive way would be to offer additional services for a price, above that of the basic free account. Would people be interested in installing MyStickies on their own websites for a monthly fee. Something that users woiuld see and optionally can use too without an account. This would be a wonderful tool for web development companies for prototyping and letting clients post feature requests on their development site. 37 Signals talks about making the interface a spec which MyStickies could really make easy. I’m sure there are many other uses as well that I haven’t thought of.
Let us know what kind of services might be useful.

Project Timer Mac version

Jacob Wright
December 13th, 2005

The project timer I made a bit ago now has a Mac version available. I also updated the Windows version a little bit. I hope it’s useful!

Downloads

flash_timer-mac-0.1.zip
flash_timer-win-0.1.zip

Let me know what bugs you find, how to duplicate them, etc. Also any additional features you can think of that I may never get to. Thanks!

« Previous PageNext Page »