Yeah yeah I know Flex is outdated tech but it has shiny buttons and who doesn't like shiny things??
Thankfully AIRDock is already generic enough that porting to flex just requires changing a few methods here and there! The DividedBox component is good enough as a "native" container; that means a lot of the stuff is already handled by Flex, and the major things to handle are just
containers! I'm not sure whether to achieve a PoC based off a direct port to AIRDock and then pare it down until the bare minimum is remaining, or to start from scratch and build up from there.
Starting from scratch has the benefit that I won't include useless cruft, but using AIRDock means I can retain compatibility and interop with pure-AS3 applications as well, which is also a huge selling point. Currently I'm leaning towards approach #1, especially since I have working results already! Voila:
All of this has been done just by calling AIR/FlexDock functions! I realize it's not a lot, especially since the following MXML code does almost the exact same thing and is more optimized:
<mx:HDividedBox width="100%" height="100%"> <mx:HDividedBox width="50%" height="100%"> <s:Panel title="leftmost" width="50%" height="100%"/> <mx:VDividedBox width="50%" height="100%"/> <s:Panel title="middleup" width="100%" height="50%"/> <s:Panel title="middlebottom" width="100%" height="50%"/> </mx:VDividedBox> </mx:HDividedBox> <s:Panel title="rightmost" width="50%" height="100%"/> </mx:HDividedBox>
But it's a start!
Further optimizations include collapsing all containers on the same level (e.g. "LLLLRF" is all on one level instead of 5, because HDividedBox supports multiple containers per level instead of just 2), along with classic Flex optimizations like deferred initialization and rendering, but those are left to much later - especially because I've just been winging it almost all the way and have started learning Flex only now (which is rather stupid of me because good luck finding tutorials that don't lead to dead links 50+% of the time...praise The Wayback Machine!)
Also, while using Apache's Tour De Flex to familiarise myself with the components available in Flex, I came across the third party Ardisia Components Library. It has pretty much everything that AIRDock/FlexDock aims to do but much better, and it even has "native-like" Windows skins as well! I would have just let this go and used that library instead to finish ASBoxer already, but there's always a catch...
No way that any hobbyist is gonna use that library unless they already have it for some reason. That's a justified but outrageous price. For reference, I paid half that for my laptop.