YubNub commands for Flex 2 and 1.5 LiveDocs

Search Flex 2 and 1.5 LiveDocs with YubNub commands

You can now search Macromedia's LiveDocs for Flex 1.5 and Flex 2 using command-line commands like flex2p mx.effects to see the documentation for the mx.effects package.

Thanks to Paul Godden's email on the Brighton New Media list, I discovered YubNub yesterday. YubNub is "a (social) command line for the Internet" allowing anyone to create commands that launch web sites and applications. How cool! Of course, I had to create one so I decided to make one to help me search LiveDocs.

The commands I ended up creating are called flex2p, flex2c, flex2d and their 1.5 counterparts, flex1p, flex1c and flex1d. To look up a package, use flex2p; for classes, use flex2c and, if you just need a shortcut to open the main LiveDocs index, use flex2d (or their equivalents for Flex 1.5.)


Using the commands is easy. Here are some examples:

LiveDocs for mx.core.Application class (Flex 2)

flex2c mx.core.Application

LiveDocs for mx.core.Application class (Flex 1.5)

flex1c mx.core.Application

LiveDocs for mx.effects package (Flex 1.5)

flex1p mx.effects

If you've been looking at the actual URLs, you would have noticed that you can invoke a command in YubNub via a URL such as:

http://yubnub.org/parser/parse?command=flex1p mx.effects

This should provide an alternative (and easy) method of providing LiveDocs integration into various IDEs. (You can, of course, issue the commands from the YubNub web site or via a plethora of third-party desktop consoles, or even a FireFox search plugin.)


The flex2c command, in particular, isn't perfect as it doesn't open up the class within the frameset, with the correct package frame set. I tried to do that but I believe I came across a current limitation in YubNub that doesn't allow more than one level of nested commands. The command that should do that is below, but currently throws an error:

http://livedocs.macromedia.com/labs/1/flex/langref/{strReplace -find . -replace / -string %s}.html&.{strReplace -find . -replace / -string {strRight %s {substract {strLength %s} {strFind -find . -reverse true}}}}/class-list.html

Instead, I used the simpler:

http://livedocs.macromedia.com/labs/1/flex/langref/{strReplace -find . -replace / -string %s}.html


Thanks go out to Jonathan Aquino for building YubNub (in 24 hours, no less, as part of the Rails Day contest) and for telling me about the strReplace command and to Allen Ormond for writing said command (as well as quite a few other core commands!) :)