Silvafug Meeting for January 2007

by Josh Tynjala

Work with Flex in the Bay Area? You may be interested in dropping by the Silicon Valley Flex User Group meeting tomorrow, January 11, 2007. The night is divided into two parts. First, from 5:00 – 7:00pm, they’ll be offering free Flex training. The topics for the month are web services and events. This will be the third of six separate classes. Don’t worry if you can’t make it. This series of classes will run again in the future.

The main Silvafug meeting starts at 7:30pm. If you’re not interested in the training, feel free to drop by for the meeting because Mark Piller, founder and CEO of Midnight Coders, will be visiting. He’ll be speaking about Remoting and AMF outside of the Java server environment. Expect some good information on WebORB for .NET, Ruby, and PHP.

The meeting takes place at eBay Townhall in San Jose, CA. You can get directions to the meeting on Yahoo! Maps. For more information, please visit the Silvafug website, and be sure to check out the mailing list for future announcements.

I hope to see you there!

Enhancement to ActionScript 3 SHA-1 class

by Josh Tynjala

Update: My changes have been accepted to corelib. Please download the official release.

Recently, I worked on a project that required me to use the SHA1 class from Adobe’s open source corelib for ActionScript 3. Unfortunately, the currently available class can only create a hash for string data. That’s cool, but limiting. With some surprisingly simple tweaks, I updated the class to work with raw ByteArray data. Now, we’re talking cool, and infinitely more useful!

//a simple string to hash with the original functionality
var message:String = "The quick red dog jumped over the lazy fox.";

trace(SHA1.hash(message));
//output: 8aa9f4a49d457eb847cb1a2e4f67a4113cdb8bdf

//write the same string to a ByteArray
var rawMessage:ByteArray = new ByteArray();
rawMessage.writeUTFBytes(message);

trace(SHA1.hashBytes(rawMessage));
//output: 8aa9f4a49d457eb847cb1a2e4f67a4113cdb8bdf (it's the same!)

If you haven’t heard, Mike Chambers arecently announced the release of Adobe’s open source ActionScript 3 libraries on Google Code. They’re hoping that this will help encourage more involvement from the developer community. I talked to Mike a while ago about my enhancements, and I’m hoping to get them integrated soon. For now, I wanted to get these changes in people’s hands. You can download the updated code here and use it under the same license terms as the original version.

I had the weirdest dream last night

by Josh Tynjala

One morning, I wake up and head over to the computer to check my email. I turn on the monitor, and I discover that my girlfriend has left a browser window open from the night before. Curiously, I take a look at the open webpages, and I find several blog postings and even a couple of webcomics. Strangely enough, they’re all about me.

Photoshop palette with 'Josh Tynjala' as a color name

Let’s rewind for a second. A couple months beforehand, in my dream world, Adobe announced a contest. They wanted to replace the default color palette in Photoshop, so they asked the community to submit their favorite colors. The winners would have their colors included in the default palette, and they’d get some random prize, like a Wii or something of that nature. Amused, I submitted a color and forgot about it.

In one of open blog postings, an Adobe staffer announces a huge list of the finalists with their colors. He asks his readers to list their favorites in the comments. As I’m reading through these comments, I keep seeing my name. That’s cool. Obviously, I picked a most excellent shade of green.

Something just doesn’t seem right, though. No one else’s name is listed in anyone’s comments. You see, the rest of the names happen to be names of colors. I quickly scroll back up to the list of finalists. Sure enough, it says “‘Josh Tynjala’ submitted by Josh Tynjala”. Apparently, that fateful day when I submitted my color, I misinterpreted the form. Rather than picking a clever color name like “Gregarious Green”, I thought it was asking for my name. Oops.

As this blog posting with the finalists made its rounds, other people started writing about it. Except the authors didn’t declare their own favorite colors. No, instead they called me a genius. You see, by naming the color after myself, I had figured out a way to get my name into Photoshop. Every day, a million designers would see my name.

That’s how I became a minor Internet celebrity… in my dreams.

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.

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