datastructure tree

So, i needed to store data in a tree structure for a menu system. I needed a generic approach and I whipped something up myself. Unhappy with the result i googled and found an excelent peace of work. A Tree class created by Michael Baczynski from Polygonal Labs. I decided to have a good look at it even-though the data-structure package is written in actionscript 3 and my project requirements are actionscript 2.

I set out to translate the Tree class as a start and it works as expected. This tree class is part of a suite of advanced data structuring classes like lists, queues, stacks, graphs, etc… Introducing articles (with CS3 source files) are available for most of the datastructures. Michael must be doing some interesting fluf, um stuff…

Translating downwards luckily was really easy. Only one as3 feature (Dictionaries) needed some special attention, but the whole ds package is now translated. I’ll host the package for now here until Michael is ready/willing to host it himself. I haven’t tested for speed, since that is not an issue for my menu system (nor should it be for you if you are stuck like me with as2). I opted for this package because it will make it easier to up the standards and convert to actionscript 3.