Monday, September 8th, 2008
When writing classes for a framework I usually put a custom toString method into important classes so that debugging becomes easier. Normally they would go like something along the lines of:
override public function toString():String {
return "[ClassName]";
}
… Sometimes adding properties to the returned String that give back information about the class, e.g.
override public function toString():String {
return "[ImageClass, size=" + _size + "]";
}
But writing them rigid like that is a disadvantage when you decide later to refactor class names. Admittedly it’s also not a very elegant way so I got the idea to take the class name that is returned by getQualifiedClassName(). The only problem is that getQualifiedClassName not only provides the type name but also the whole package String of the class. Regular Expressions to the rescue! After twiddling around with them for a while (I’m by no means a RegExp expert) I got my toString method into the shape that I desired:
override public function toString():String {
return "[" + getQualifiedClassName(this).match("[^:]*$")[0] + ", size=" + _size + "]";
}
This way it matches the String returned by getQualifiedClassName with the Regular Expression [^:]*$ which checks from the right end for an arbitrary text up to the first occurring colon, but without including the colon. Taking the first element of the Array returned by match() and you got what you need!
A nice way of using this is when writing abstract classes that contain the toString method and any subclass can use that toString method without the need to override it … that is of course unless you want ot add other output information.
Filed under Dev, Random Picks | 8 Comments »
Monday, August 25th, 2008
It took longer than expected thanks to obstacles like a crashed harddisk and other minorities in between but it’s finally done and I now can announce the immediate availability of Alcon 3! It runs currently on Windows and Mac and hopefully soon on Linux too. When I tested it on Ubuntu it installed and started fine but the LocalConnection seems not to cut it in the current alpha release of the Linux AIR Runtime. Anyone know more details about this?
I recommend to check out the Alcon Page for more details and of course the download link. Enjoy your debugging!
Filed under Dev | 3 Comments »
Thursday, August 21st, 2008
Since so many of you (well, at least four people) are feverishly waiting for the release of Alcon 3 here’s a preview screenshot to comfort your waiting time. The shot shows Alcon’s trace output panel with some bogus Array being traced iteratively and as a hex dump. the top of the window displays Alcon’s new App Monitor which can be used to monitor framerate, frame render time and memory consumption. It also shows the version of the runtime that the monitored application is run in (clicking on the version text will list all System.capabilities properties in the Trace panel).

Then there’s the Options dialog with Trace options opened where you will be able to set font, colors etc. On the File Loggers Options you will be able to optionally enable up to two File Loggers that can be used for example to log the flashlog.txt to see output made by ActionScript’s own trace method.
There’s of course the new Object Inspector and a new Help panel for Quickstart Help and API Docs. Alcon 3 is being written 99% in ActionScript 3 using FDT (the 1% left being the Main.mxml that is necessary to compile a Flex application). It’s only a matter of a few days now until release, some bug fixing, finishing touches and a few more documentation to write and it will be out so please endure!
Filed under Dev | 10 Comments »
Tuesday, December 4th, 2007

In game development randomness is often necessary for certain tasks, be it the random distribution of graphic tiles, a random factor in NPC AI or random stats in a roleplaying game. Especially for the latter purpose the static Dice class provides a set of methods to roll dice as it is common in a Role-playing game, to be exact four-, six-, eight-, ten-, twelve-, twenty-sided and percentile dice.
(more…)
Filed under Dev, Featured, Random Picks | 4 Comments »
Monday, October 15th, 2007
The guys at Powerflasher done a great job! Check out their new FDT 3 at fdt.powerflasher.com. Personally this has become once again my favorite coding tool (after an over one year break with FlexBuilder’s editor). FDT has many features that one would otherwise only find in superior tools like Eclipse’s own Java Development Tool … and these are top notch! FDT is now shipped in three different versions, Basic, Professional and soon an Enterprise version which will add a Debugger, MXML Parser and advanced Refactoring.
I’m especially looking forward to the MXML Parser since in it’s current state FDT only allows for pure ActionScript projects. The MXML Parser would make it possible to add Flex and Adobe AIR projects to the roll.
Filed under Dev | 1 Comment »
Friday, September 28th, 2007
I’ve updated the AnimatedBitmap class so that it now uses an external timer object to trigger the animation. The advantage of this is that one timer can be used for many animated objects that use the same framerate. For this purpose a custom FrameRateTimer class has been added. This saves memory and CPU cycles when many animated objects are used.
I will eventually add an AnimatedDisplayObjectManager class later with that many animated objects can be controlled at once (e.g. stop/play all sprites at once) but this will probably be more intervened with the whole framework (as it might make use of custom data structures).
Filed under Dev | 3 Comments »
Sunday, September 23rd, 2007
The AnimatedBitmap class provides functionality for Bitmap objects that are animated by using a series of still images. When creating a new AnimatedBitmap you provide a BitmapData object that contains an image that consists of the ’single-frame’ images for the animation.
(more…)
Filed under Dev, Random Picks | 26 Comments »
Monday, September 3rd, 2007
I’ve joined the closed beta of FDT 3.0 a couple of weeks ago and saw that there was steady progress in bug fixing with around 3-4 updates every week. Now the guys at Powerflasher started the Open Beta which everybody can join by visiting the FDT Forum.
FDT 3.0 is pure coding comfort indeed! After using it you’ll agree that the Flex ActionScript editor looks like a poor excuse compared to FDT! There are all the features for ActionScript 3.0 that also were in FDT 1 and a lot of new stuff. Luxurious syntax coloring and semantic syntax highlighting, code templates,my number one favorite feature Mark Occurences, code formatter, quick fixes, Flash IDE and Flex compiler support, limited refactoring and more.
Now all I wish for is that FDT works flawlessly together with Flex/AIR projects but that will probably come at a later date since getting a stable release is more important now. It kind of feels awkward if you have to go back to the Flex AS editor once you used FDT!
Filed under Dev | No Comments »
Thursday, August 30th, 2007
Alcon is a lightweight debugging tool for ActionScript developers that provides several straightforward and quickly accessible methods to debug any ActionScript 2 or ActionScript 3 application, be it from the Web Browser, the standalone Flash Player or an AIR Runtime. It offers an easy way to output debug information from anywhere, not just while in the Flash IDE or in the Flex Debugger. It comes packed with an Application Monitor that can monitor the framerate and memory consumption, an Object Inspector for viewing the properties of any Object, Array or Class and up to two File Loggers. Alcon runs on any platform that supports Adobe AIR and can be used with the Flex compiler, the Flash IDE or MTASC.
(more…)
Filed under Dev, Featured, Random Picks | 36 Comments »
Sunday, June 10th, 2007
Recently I needed a HashMap for a project to map key/value pairs but in that particular case the Map required to map not just one but several values to a key. I could have used an array or object to store the values in and map that one but in practice it turned out that accessing the map looked rather messy. It would be much more elegant to have a map to that multiple values can be mapped directly. After some investigation (strangely even Java seems not to have a MultiMap included) I came up with writing my own MultiMap class, so here it is!
(more…)
Filed under Dev, Random Picks | 11 Comments »