The other day I finally borrowed a Mac for a couple of days with the plan to fix MiniBuilder on this platform.
As I recently received a patch that fixes copy/paste on Mac from a guy named Romain (thank you very much), it looked like it was time to make the bold move. So I installed MB on the MacBook and checked out the AirMiniBuilder project. And here’s where I was faced with the frustration of not having any option for copy/paste in the editor. Payday for me, I had to manually type the patch.
Seems OK now. I added a switch for the platform and I did the deploy. Mac users can install version 1.1.2 alpha and enjoy MiniBuilder.
There is still a problem on Mac, at least one that I’m aware of: the project window menu is not refreshed when you work with more than one project at once. If you switch form one project window to another, you end up with the menu of the old window. The workaround is to restart MiniBuilder when you change the project. MiniBuilder exits when all windows are closed.
Development on MiniBuilder, the Flash/AIR IDE for ActionScript projects continues.
There were a few releases since my last post on this blog. If you want to keep a closer look, follow MiniBuilder on tweeter http://twitter.com/minibuilder
Latest important couple of features are Go To Definition and Back. Move the cursor inside any identifier defined in your project and press F4 to go to the place where your symbol is defined. It might be a class, a field, parameter or a local var of any enclosing closure. Then press Shift+F4 to return to the place you were before. I know, that’s very very useful
Also, now you can customize the keyboard shortcuts, finally.
The days where you had to install heavy IDE to write just a few lines of ActionScript are over. MiniBuilder works on Linux and Windows and its main features are:
Code completion for your classes, default libraries and your swc libraries
Project tree, multi-tabs editor
Fast(!) text editor (written from scratch – it only renders the visible part of the text), it can handle up to 1000 lines in a class without becoming unresponsive.
Integration with compiler errors. One click goto-error file and line.
Many other features.
MiniBuilder on wonderfl.net (a customized stripped-down version of MiniBuilder)
This ActionScript debugger console is not a specific feature of MiniBuilder. It is just a swc library that you can use in any Flash/AIR project, no matter the IDE you use.
For MiniBuilder, it comes as a default, one reason for this being that MiniBuilder doesn’t come with an embedded debugger.
To make a short digression here, actually few developers in the real world use a debugger. But first, let’s clear a little bit the terms:
Debugger: a tool that, working together with (sometimes a special version of) the code interpreter (VM), can stop the program in predefined points (breakpoints), execute the code step by step and has other abilities like whatching variables, etc.
Tracer or logger: a tool that allows code to execute “trace” commands that output values from the runtime environment. These trace statements have to be compiled with the application. Oftentimes, providers of such tools name them “console” but this is not appropriate. See next:
Console: a tool that allows entering text commands to be executed against the running environment of the application. Take a look, for example, at the ubiquitous FF Firebug, or Developer Tools in Chrome browser. They both come with various tools including a real javascript console.
Without underestimating the power of a real debugger, I have to admit that on all the large Flash projects I’ve been part of during the years, none of the programmers did use the debugger regulary. Instead, most just used trace and even throw (funny, isn’t it?).
Now, what’s this thing that I’m presenting you under the name of DebuggerConsole? First of all, it is not a debugger. But indeed, it is a console in the proper meaning of the term. And a tracer. Although, I did not embed a real ActionScript interpretter (for reasons of size), DebuggerConsole can deal with assigns, simple binary opperators, method execution with parameters that can be references, all in the real running environment. And it even provides some code completion! Towards the running environment. How cool is that? Of course, it records previous commands in a history, similar to unix shell. The history is stored locally across sessions.
It’s been years since I can’t work without this console, and right now, I find little use in the debugger. It started back in the AS2 times and now it is much more powerful. You can make it show at startup, you can trigger it programatically or you can trigger it at runtime using javascript. In any case, it starts recording the traces right at the application start, no need to have it turned on. In case a problem shows up, just turn the console on using javascript and start inspecting the variables, or run code rigth there. Next time you might not be able to reproduce the bug!
One of the latest features we found useful to have is the ability to create trace namespaces. When several programmers work at the same project, the trace log gets quite big and you forget where traces come from. Using this feature you can associate your traces with a particular namespace, a simple string that the developer uses for a certain module. If, at runtime, you use the console to set a current namespace, you only see traces from that namespace. If you then turn namespace off, you can see all traces again. The current namespace is stored locally across the sessions.
Init the console in your application entry point:
Debugger.setParent(this, true);
The first param should be a display object that will be added to stage
The second param, tells the console to show right away. If set false, you can still show the console using javascript. You will need to call the function “debug()” on the object dom instance.
The trace command for DebuggerConsole is “debug”. Example:
debug('myVar=' + myVar);
to use a namespace, you need to issue something like this in your code:
debug(['module1', 'myVar=' + myVar]);
Here’s a video with a more detailed example. Forgive me for not adding the voice, I’m probably not such a good speaker anyway. Things to check in the video:
Setting up the console
Tracing, tracing with a namespace
Setting a local reference in the compiled code to have it available in the console
Using the console: print variables, assigning, running methods, code completion