This is something I’ve been wanting to do for quite some time.
Many moons ago, I created a simple GUI for asdoc.exe (the tool that creates nice looking HTML documentation from actionscript class files for those wondering – though I can’t imagine anyone reading this and not knowing) using SWFKit. Well, it was about the same time that Apollo first appeared (or maybe it was AIR beta 1 by that time – who can remember), and I thought it would be great to convert the whole project into an AIR application. It didn’t take long, though, to discover that AIR was not capable of launching applications in their native habitats, so that ended that. Then back in January, Mike Chambers published a means of integrating AIR with C-Sharp thereby gaining a closer OS relationship. This would let you do things like launch applications and take screen shots straight from AIR.
Finally, four and half months later, I got the time to “play around” and test out this intriguing proof of concept. And so enters ASDoc GUI version 2.0 – this time created in Flash/AIR but, thanks to CommandProxy, capable of launching asdoc.exe.
You can see some screenshots below.
You can download the project here, but because this was only a test of Mike Chambers’ concept, I didn’t bother building a custom installer and manual installation, while not wildly difficult, may be a bit tricky.
To install:
- Download the .zip file here and extract to wherever desired.
- Install the ASDocGUI.air file (requires latest version of AIR runtime to be installed), but don’t run it (well, you can go ahead and run it if you want to. It won’t break anything – but it won’t work, either).
- Navigate to the installation directory (on Windows that’s C:\Program Files\ASDocGUI by default) and drop in the GUILauncher.exe file. GUILauncher.exe and ASDocGUI.exe should reside in the same directory.
- Now simply run GUILauncher.exe – it will automatically launch the AIR application and you’re in business. If you desire a shortcut on your desktop (or anywhere else) make sure it’s a shortcut to GUILauncher.exe.
The above instructions also come in a readme.txt file included in the .zip.
A few things to consider:
This isn’t the prettiest application ever created. Because this was all just a test of Mike Chambers’ ideas I didn’t do much beautification. The design is simple as heck. The GUILauncher.exe will run at the same time as the AIR app. Don’t close it, it’s necessary and will also provide a little feedback about what’s going on inside a console window. Speaking of feedback, expect little to none. The application works fine when all goes well, but when it doesn’t go so well, it will fail silently. Make sure you know generally what you’re doing as far as asdoc commands and expectations are concerned. If I get a bit of positive feedback, I just may make a more user friendly version. It works fine for what I use it for, however, and it certainly served its purpose demonstrating the CommandProxy concept.
Speaking of which, the CommandProxy concept is, first of all, very simple to put into effect. I believe the largest amount of development time went into creating an Accordion component (which I will post at a later date after I clean up and better document the code as it’s now a part of my ui package). I see no reason why Adobe should not implement a similar .api in AIR itself in a later release. I understand that security is a concern, however, other .swf wrappers (Zinc, SWFKit, etc) have been doing these types of things for years. I see no reason why Adobe shouldn’t hop on board and really utilize it’s own technologies to the fullest extent.
By the way, if anyone tries this out with a MAC, please post a comment. I’m curious to hear the results.
For more information on the CommandProxy “Proof-of-Concept”, get it straight from the horse’s mouth.
“I see no reason why Adobe shouldn’t hop on board and really utilize it’s own technologies to the fullest extent.”
There’s really one main reason they didn’t add this feature: They want to try and force people to make cross-platform AIR apps. By making it hard to call native code, they hope to encourage people to only use cross-platform SWF/HTML content. As you’ve noted, it’s not really a security concern, since AIR apps already have plenty of access to the filesystem and could easily cause all sorts of trouble as is.
Personally I think it’s dumb to cripple a tool to enforce an ideology.
That’s a good point, David R, and actually one I meant to bring up. I wouldn’t call it “dumb” to encourage cross platform development – it really is AIR’s biggest and best feature and is quite an achievment so far. However, they (the Adobe team) have already blurred the line a bit. For example, the NativeMenu object supports an Application menu (for Mac OS X) and a Window menu (for Windows) as well as a Dock icon (Mac) and System tray icon (windows). I think they could “easily” extend the File object’s api to include a launchNativeApplication() method that varies according to OS in a way similar to NativeMenu. Of course it could be argued this is a slippery slope and soon everyone would want all OS api’s exposed in some way, but I don’t think so. I believe that such base abilities as taking screen shots or launching native applications are at least as important as adding dock or system tray icons. But maybe that’s just me.
Devon, this looks great (why hasn’t Adobe provided an ASDoc GUI?), but your suggestion to try it on a Mac would be fruitless, since you provided an EXE file which would only run under Windows!
We’ll just pretend I didn’t say that.. :)
Looks promiing, but I the GUILauncher.exe app fails to launch on XP for me..
I apologize for the difficulties, noponies. I created the whole thing on Win XP and it works fine for me. I can’t tell what the problem may be.
I was googling around for GUI tools and got two tools probably developed by you. Seems like you are the ASDocs guru.
well none of the tools worked for me as I get this error.
pnpDetails.mxml: Error: Unable to locate specified base class ‘view.panels.customPanel’ for component class ‘pnpDetails’
I have a customPanel.mxml which is a customised panel and i am using it in other custom mxml components.
my panels start like this
….
….
do you think, that would be a problem. How do I solve this.
oops.. some tags jus disappeared
Hey, Varun.. Don’t know how I became an ASDoc guru and I’m honestly not sure if I could help out or not, but go over to the contact form at http://www.onebyonedesign.com/index2.html (“when” section) and drop me a direct line and we can try to figure out what’s happening..
Devon,
I’m running XP via virtulisation, so thats prob why. In the end I just wrote an ant task for flex, works like a charm.
Congrats on your guru status!
Wait a minute. I have guru status?
Glad you got it working noponies…
Looks cool and I was looking forward to not having to type in the command line anymore – but, same problems as noponies. I’m running XP in Bootcamp on a Mac so guess this may have the same issue :-(
oh well!
Very nice! :) I was hoping something like this was around.
I’m currently using a plugin for FlashDevelop, but it doesn’t have as many options, and isn’t really all inclusive of the different options available in ASDoc, and instead you have to type those values in manually.
Does this work with the newest release of ASDoc (currently in BETA)? I use that version because the current one does not support typed Vectors.