TreeMap source code for Flex now available

by Josh Tynjala

In hopes of spreading some holiday cheer, I’m happy to announce that the source code for my Flex TreeMap component is now available for download on Google Code. You’ll need to access the code using a Subversion client. I recommend TortoiseSVN, but many others exist.

The code is available under the terms of the GPL, version 2 (Author’s Note: It is now MIT licensed for extra usefulness!) This means that you can use my component for free, but you must release your full source code using the same license. This is a great opportunity for other open source projects looking for advanced visualization solutions.

If you’re unfamiliar with my previous work on this component, have a look at a sample that demonstrates selection:

Preview of Flex 2 TreeMap with selection enabled

Once you’ve got the source code downloaded, and you’re ready to get started, be sure to look at the sample applications in the “examples” directory first. They give you a few tips and tricks for using some of the more advanced functionality the component provides. Additionally, you may access the online documentation generated by ASDoc.

To build the TreeMap SWC, you can run the Ant script “build.xml”. You may need to update the build.properties file with the location where you installed the Flex 2 SDK (it’s free to download and use if you don’t have it already). Once I’m happy with the feature set of the component, and I’ve had more time to search for bugs, I plan to make zipped released with the SWC prebuilt for you. Right now, the code is considered beta quality! I have fixed some bugs recently, and I expect to encounter more. If you happen to find a bug, I encourage you to submit it to the issue tracker, and I’ll take a look.

That’s it for now. Stay tuned for future updates. I plan to write several more examples to include in the repository to get folks started. If you find yourself having trouble using a certain feature, please let me know. Either place suggestions in the comment section below. Once again, happy holidays!

Learn Ruby on Rails with 'Up and Running'

by Josh Tynjala

Ruby on Rails has become the poster child for cool in the server development world. Several months ago, hoping to find out what all the excitement is about, I installed Instant Rails, a nice all-in-one web server package and checked it out. As you probably know, I’m a Flash guy so I prefer developing for the front end. Even so, I quickly discovered that people had good reason to love RoR as much as they do. It’s beyond easy to work with and it’s a lot of fun!

Recently, I received a copy of Ruby on Rails: Up and Running a thin little book by Bruce A. Tate and Curt Hibbs. It had been a while since my initial discovery of RoR, and I wanted to learn more. Coming in at a mere 167 pages, I didn’t mind sitting down to read this book. Seriously, it’s a super-thin book, and I think many people might pass it up because it looks useless. However, I found that the authors crammed a ton of knowledge into every page.

A warning: This book assumes that you aren’t a programming newbie. It does not contain any introductions to the Ruby language or Object-Oriented Programming. It covers the basics of the Rails framework–enough to cause some damage–and that’s it. If you think RoR sounds pretty cool, but you don’t know Ruby, I would recommend checking out an online book, Programming Ruby: The Pragmatic Programmer’s Guide, first. It’s free and packed with information. Ruby is a bit different than other languages that you might be used to like C, Java, or Actionscript. That can be disorienting at first, but once you pick it up, you’ll be golden.

The first chapter covers the very basics. You’ll get InstantRails, the “one-click” web server I mentioned earlier, all set up. The authors examine the structure of a Rails project, and they show you how Rails provides all sorts of scripted generators to make file creation fast. You’ll look at the built-in Model-View-Controller (MVC) layout, and work a bit with the Controller and the View.

Over the next couple of chapters, you’ll learn about ActiveRecord, an exciting way to work with and abstract your database from the application. The authors show you some naming conventions that Rails naturally understands for connecting your classes to database tables. Similarly, some built-in functions provide ways for you to create relationships between your classes that match your table relationships.

The third chapter introduces scaffolding. In the early stages of the development cycle, you often need to put together simple interfaces so that you can interact with your application. Generally, these will be scrapped later for the final design. To make up for this lost development time, Rails provides scaffolding to build these temporary pages for you. It’s easy to replace these pages when you’re ready, or you can even ask Rails to give you the code it generated so that you can flesh out and build on top of the scaffold.

Before going into a chapter on unit testing, the authors show how to work a bit more with views. These are the actual displayed webpages. They cover things like templates for things like common headers and footers and functions for including stylesheets, images, and links (to generate properly structured URL for you). After that, you’ll discover an entire chapter on AJAX including built-in techniques for drag-and-drop, data filtering, and content replacement.

The holiday break is a perfect time to cross-train in other languages and work on fun projects for which you don’t normally have time. If Ruby on Rails is part of your to-do list, consider picking up Ruby on Rails: Up and Running. Merry Christmas and happy coding!

Preview of my Flex 2 TreeMap Component

by Josh Tynjala

The other day, I mentioned that I’ll be releasing an open source version of my Flex 2 TreeMap component. I need just a bit more time to make some finishing touches. Plus, I’ll be spending the next week finding a new apartment, moving in, and starting a new job. To keep you all drooling over the upcoming possibilities, I thought I’d take a minute to share a cool new preview of the component and some useful new features!

Preview of Flex 2 TreeMap and Tree Components Comparison

As you can see, the TreeMap is sitting side by side with Flex’s standard Tree component. Both components are connected to the same data source. Any form of data that you can display in a Tree, you can display in a TreeMap. In fact, just like the Tree, it supports custom data descriptors to allow you to use all sorts of interesting data structures.

<mx:Tree id="tree" width="100%" height="100%"
	selectable="false"
	dataProvider="{sampleData}"
	labelField="@name"/>

<zeus:TreeMap id="map" width="100%" height="100%"
	styleName="TopLevel"
	dataProvider="{sampleData}"
	labelField="@name"
	weightFunction="{getItemWeight}"/>

In the MXML code snippet above, you can see the declarations for the two components. They’re pretty similar. Both are bound to the same data provider. Both use the “name” XML attribute for the labelField. The TreeMap component also has a weightFunction (which works like the labelFunction used by many Flex components) that is bound to a method that calculates the weight or size of nodes in the component.

During development, I kept one thought in the back of my mind: “Customization is key.” You can set fields or functions to determine renderer labels, colors, weights, and tooltips. Of course, the component’s appearance may be customized with Flex’s style system. You can see that I set a style name on the TreeMap above to allow it to be styled a bit differently than the enclosed TreeMaps. The headers have styles much like Accordion headers, and the node renderers have styles a lot like Buttons. You can even create custom renderer classes to add new functionality to the nodes. Imagine placing simple bar charts inside the nodes to show changes over time, or perhaps control bars on each internal TreeMap with components that alter the node colors or other properties.

Click on one of the headers if you haven’t already. Users may zoom enclosed treemaps up to the top level for a more detailed view. This can be useful for complex visualizations where labels might be difficult to read. If you click on the header again, it will zoom out one level, and you can continue all of the way to the top. It’s not implemented yet, but I hope to add transitions to zoom operations to make them more Flashy and user-friendly.

That’s it for now. Hopefully, once I’m settled into my new apartment, I’ll be able to get the first official release out the door. I intend to keep a public source control repository so that everyone can check out the latest and greatest code. I will also package up important milestones and make them available for download. Stay tuned for more!

100th Post Extravaganza! (FREE Code)

by Josh Tynjala

In celebration of my 100th post, I’d like share some code with you. As you may know, the Flash Platform code example service IFBIN went open source a few months ago, and version 2.0 will be launching at some point in the future. I created several examples for IFBIN, but a couple of them were created using the pre-release versions of the Flex 2 SDK. Until I can get access to the new service, I’d like to share some updates to my code right here on Zeus Labs. In fact, I intend to make sure that any examples I make available in the future will be mirrored here for easy access.

Moreover, I’ve put together a series of project pages for several of my major open source projects. In particular, you’ll find centralized information on my Flex Instant Messenger client, my Actionscript 3 particle systems experiments, the HelpPanel plugin for FlashDevelop (and any future FlashDevelop plugins I may decide to make), and the Flex TreeMap component. Let it be known now that my TreeMap component will be open source again soon. I intend to release it under version 2 of the GPL. A licensing option for commercial projects will probably be available as well.

Thanks for reading Zeus Labs. I appreciate you all. Happy coding!

ActionScript 3.0 Cookbook will stay by my desk

by Josh Tynjala

Joey Lott, Darron Schall, and Keith Peters provide one of the first published overviews of Flash 9 and AS3 in the ActionScript 3 Cookbook. I had never picked up one of O’Reilly’s “cookbooks” before, but I quickly discovered that this format might be perfect for my picky reading habits. The book comes in at over 500 pages, and it’s the first release from the new O’Reilly/Adobe partnership known as the Adobe Developer Library.

Like most programming language books, each chapter in the AS3 Cookbook focuses on a specific aspect of the language. One chapter focuses on the Display List, another on Arrays, and so on into Bitmaps, Math, and others. What sets this style of book apart is that each chapter contains a series of short “recipes” that focus on the chapter’s main subject. For instance, the Regular Expression chapter includes solutions for simple problems like replacing text and validating user input, but an additional discussion section provides a few extra insights that more comprehensive language books might miss.

I found myself immersed in chapters on core language features, like the one on Arrays, even though I felt I knew these subjects pretty darn well already. With so many short and sweet sections, I discovered a dozen different tricks that I know I can use in my everyday development. For example, did you know that you can easily copy a single-dimensional Array by calling the concat() method with no arguments?

var myCopy:Array = myArray.concat()

Somehow, that had slipped under my radar.

I didn’t have too many issues with this book. Mostly, I found myself wanting to count the number of typos I discovered. You can expect to see a second printing, if only to fix the spelling mistakes and missing letters here and there. They’re not overly distracting, though. I had too much fun with the subject matter to let it bother me. I also noticed that there are several references to Flash Player 8.5. In some cases, it seemed to work, but in others I wondered if it would just be better to say Flash Player 9. Since it was released as an alpha player, it probably shouldn’t be considered an official release. SWFs made with the alpha version of the Flex 2 compiler won’t run in the official Flash 9 player these days. I’m guessing we won’t see it in the archives either.

All in all, the ActionScript 3.0 Cookbook kept me pretty entertained. I enjoyed that its recipes fit into a page or two each because I could easily sit down and read a couple when I had a few extra minutes. The next time I picked it up, I’d be jumping into fresh material that generally didn’t depend on previous sections. If you’re looking for a definitive language overview, this book isn’t what you want. You’ll probably want to pick up Essential ActionScript 3.0 when it comes out next year. Keep the AS3 Cookbook close to your desk as a quick reference for useful tricks or to give you a crash-course on a particular feature that you haven’t used yet.

Flash Switcher Extension for Firefox

by Josh Tynjala

Alessandro posted a cool extension for Firefox that allows a developer to swap out different versions of the Adobe Flash Player without installers or browser restarts. It’s a great tool for testing player compatibility, and you’ll be able to see instantly if your Flash version-checking script works correctly. Best of all, it comes with every player all the way back to Flash 2! How’s that for overkill? ;)

After I installed the extension, I immediately added the Flash 9 debug player to the list. Until now, I specifically ran the release player on Firefox and the debug player in IE. I didn’t want to limit my performance when checking out the cool AS3 experiments everyone has been making. Now, I can easily switch to debug mode to catch bugs when I’m working on my own cool experiments.

By the way, if you’re looking for something a little more arcane (I always a found it little difficult to use), you might want to check out Flash Plugin Switcher. It works for both IE and Firefox.

A new direction for me, and Flex developers needed!

by Josh Tynjala

On December 4, I will be joining Flash Platform team at Yahoo! in Sunnyvale, CA. It should be an extremely exciting opportunity where I’ll get to influence the direction Yahoo! takes with Flash technology, and the team hopes to release some useful components and other code to benefit the whole Flash community. Stay tuned for more on that front.

As a result, my current employer, Business Objects needs a couple of talented Flex 2 developers ASAP to fill my shoes and further expand their component development team for Crystal Xcelsius in San Diego, CA. Xcelsius is a pretty cool application that lets business users create rich dashboards and presentations with Flash components, Excel spreadsheets, and other data sources. Ideally, you should be familiar with Adobe Flex 2, MXML, Actionscript 3, and you should have a strong understanding of the architecture behind the Flex framework and the creation of custom components. Please let me know if you’re interested in learning more about these positions.

MAX, CSS Reboot, etc.

by Josh Tynjala

I’ll be heading out for MAX in a couple hours. It’s my first MAX and my first trip to Vegas. In other words, a kick-ass good time! I’ll be at a bunch of Flex, Apollo, and other random sessions, so be on the lookout for me. Brown hair, black plastic glasses, and I’ll have my IFBIN-branded bag at my side. You may see me hanging out with with Flash rockstars like Jesse Warden or at the MAXUP unconference put together by Ted Patrick. Maybe you’ll catch me developing a cool project in some dark corner.

In other news, what’s up with the CSS Reboot? It has had virtually zero content for some time now, and the rebooters page gives a nice MySQL error. I’m unimpressed. I didn’t finish a new design for my blog, so it doesn’t bother me too much. Today, I found the Standards Reboot website. It seems to have some decent sponsors, so check it out if you want to reboot on November 1st. I have a lot of cool ideas to spruce up this old place, but I just didn’t have time to put them all together. I’ve barely found time to try out my new Nintendo DS because my day job, a little freelancing, and other top secret projects have kept my free time near zero.

Note to self: Write funnier code.

by Josh Tynjala

Google Code Search is pretty cool. Certainly, you’ll discover some oddities and troubling security issues, but I imagine that this might be helpful to a lot of folks looking for some quick fixes. I like that results will show the type of license if Google’s crawler can find it.

A funny query that someone on Slashdot pointed out makes me want to refactor some of my Actionscript code:

private static const POPE_IS_CATHOLIC:Boolean = true;

public function doSomething():void
{
	while(POPE_IS_CATHOLIC)
	{
		//do something
	}
}

It will be interesting to see if this and other code search engines help to discover GPL and other license violations. Obviously the code has to be accessible to the public for the crawler to find it, but I imagine that it’s still a useful tool in that realm.

Flex 2 UITextFields don't allow percentage dimensions

by Josh Tynjala

FYI, the documentation doesn’t say anything about it, but the percentWidth and percentHeight properties don’t work on UITextField instances in Flex 2. Here’s the spartan implementation of the percentWidth property:

/**
 *  @copy mx.core.UIComponent#percentWidth
 */
public function get percentWidth():Number
{
	return NaN;
}

/**
 *  @private
 */
public function set percentWidth(value:Number):void
{
}

The documentation states that these properties may be set to values from 0 to 100. I’ve submitted a bug report, but I thought I’d send out a warning.

I guess it’s time for a little subclassing. I’ve been having a lot of frustration with text-based components in Flex. Labels can only be a single line. UITextField seems to be the best bet for multiline text because the Text component is a horrible pain in the rear that doesn’t seem to like word-wrapping. Flex team developers, if you’re listening, I want better text-based components!

Pages: Prev 1 2 3 ... 11 12 13 14 15 16 17 18 19 20 21 Next