As part of my learning the Flex platform, I plan to write some sample Flex applications to see how various things work in the system. In particular, I want to play around with MXML, ActionScript3, Flex components, Flash APIs, and general UI and graphics functionality in the platform. And I definitely want to play around with filter effects, states, and transitions, of course; I find them very moving.
To begin with, I wrote a simple vector drawing application. There's not enough of them out there, right? I remember a decent one on the original Macintosh in the mid 80's, but who's got one of those machines lying around these days? It's way easier to write a new version in Flex than to search around EBay for an old Mac and then find some place to store the thing when you're not using the drawing application.
Here's the application, hopefully running here inline in your browser window.
6 comments:
Fantastic. I can see this blog being a really great journey for users just making their first Flexy steps. I like your idea of explaining the modifications you've made to improve it. Keep it up!
Yes, the flex app seems to run fine here, although the 'Clear' button appears to stop working once you've used it once.
Excellent article.
It’s very interesting to see how much you can accomplish with so few lines of code (compared to Swing). Nice look and feel too.
Thanks.
Aziz: To be clear (and honest), the code shown so far is not the full extent. So while I agree that it takes relatively few lines of mxml code to create a nice-looking UI, there's definitely a bit more going on here behind the scenes (like all of the logic for handing the mouse events and creating/editing the shapes).
I hope to walk through the other interesting files in the next blog or two, then you'll have seen it all.
It's not complex code, to be sure, but I just wanted to make sure that it's understood that I've only shown the code for the GUI layer so far....
thustle: Thanks for the sanity-check. I'll see what's up with the Clear functionality.
thustle: the clear button problem is fixed, so it should work now (here and on the other parts in this series).
Is there a chance to save the drawing as a png?
Tim: That's totally doable, but not with the current browser-based version of the app. If the app were ported to an AIR app, you'd have access to the AIR functionality, such as saving to local files. A demo for anyother day...
Post a Comment