Yeah yeah I know Flex is outdated tech but it has shiny buttons and who doesn't like shiny things??
Well, this aged poorly. FlexDock (the planned AIRDock -> Flex port) has been put on hold until further notice.
Original post follows below.
---
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
- traversal
- creation
- dragging
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...
...it's $600!
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.
Cyberdevil
Not sure what Flex is (though the name rings a bell) but it seems related to AIR/Flash, of course I could just Google at this point but...
What's the planned use for this? Can you embed it? Standalone program?
I'm not really catching the use case but fun to read regardless... and hell yeah that's too much... bought my current stationary for a similar amount. Bought second-hand computers for half of that since, if not less. Yeah.
Reminds me of... well that didn't work. Was going to link to a jukebox I made for my site back in the day in Flash that fetched audio files/titles/etc from an .xml file in the same directory, but apparently it doesn't support the latest version of Flash Player now... new times new problems. :/ Would be cool to implement Ruffle on a site outside NG though. Should work fine for pretty much everything I've made...
Gimmick
Flex is a layout and component library for Flash. Like JavaFX or Swing is to Java, or Qt or wxWidgets is to C++, so too Flex is to Flash.
It's mostly a library, so other developers can use it to make applications that have that "draggable and dockable panels" style layout possible. Like in FlashDevelop, or VS Code, or pretty much any IDE these days, dockable panels make organization really neat.
Was the jukebox made in AS2 or AS3? I'm kinda interested in knowing what sort of error it threw up.