Jun 1, 2010

Playing some more…

So, in my last post I showed how easy it was (or at least will be) to use SWF/SWC libraries in haXe. And this time I just wanted to quickly demonstrate that not only can you use the libraries, but you can just as easy extend them without much hassle!

So, once again I’ll be using minimalcomps as an example because I needed to have a sortable and editable version of the List component.

So what I did was:

  1. Extend the List component to become a SortableList.
  2. Extend the ListItem component to become an EditableListItem.

And I’m just surprised how problem free this was, at least as long as I don’t need to override any getters or setters. And I can even statically type the list items!

Instead of having all the code embedded (as there’s a few classes) you may find my example here as gist. Hopefully one day github will accept haXe as a language that should be color coded as well…

Comment
About
developing software is fun.
sitting in a pleasant sofa is fun.
combine for double the fun.
Search