This blog isn't maintained anymore. Check out my current project, an agile/scrum management tool.

Saturday, June 30, 2007

Popup Menus and Graphical Buttons

Skinning Flex controls can be a pain. You need a designer who really knows what they're doing and you have to embed your assets in your application (or at least I haven't seen a way around that).

On a current flex project we want some buttons nicely designed by a flash guy. Those buttons should open a popup menu with more buttons on it. (like any standard toolbar)

Requirements:
  • Easy way for designer to create graphical buttons.
  • A way of using those graphical buttons in a button/popup combination
  • Load assets at runtime so they can be swapped out easily (for different languages for instance)
  • Include keyboard navigation
  • Simple to use

Solution:

First, I created a graphical button that will load in a standard swf with some specially named frames. The designer puts the different button states in the different frames. (There HAS to be a standard Flex control for this, but I couldn't find it. Any suggestions? I'd love to replace my little custom implementation with a standard one.)

Then I created a combo-box like control that uses those buttons with a popup menu.

Results:
http://www.rogue-development.com/popup_menu/sandbox.html


I'll package this up and publish under an MIT license sometime soon if anyone else is interested.

Labels:

Thursday, June 21, 2007

Time for Linux

It's been a while since I last ran Linux. I've been really reluctant to install on my new Dell desktop since I don't have installation CD's to fix it if things go horribly wrong. I'd really like to give Flash development a shot on an open source platform.

A while back I did some searching around and found a live CD including GParted / Clonezilla. I downloaded it and threw it on a CD.

Today, UPS brought me my new 250gb USB hard drive, so maybe it's time to get into this.

Clonezilla is a Norton Ghost workalike. I was able to quickly create an image of my entire hard drive, including partition table, MBR, and those pesky DELL specific restore partitions. All in all it took maybe half an hour. Hopefully, this will give me a safe source to restore from in the event that I mess things up.

GParted is a Partition-Magic workalike. As I'm typing this blog post it's resizing my Windows partition and moving the DELL restore partition. Then it'll create a new partition for my Linux install and I'll be ready to go.

When that's finished, I'll be installing KUbuntu for a linux distribution, and eventually Beryl, a nifty 3d-enabled windowing system.

With any luck, my next blog post will be made from my freshly installed linux system.

If things go horribly wrong, I'll be making my posts on this Laptop until my desktop gets straightened up.

UPDATE - Windows still boots up after my partition resize! Repartitioning was my biggest fear of messing up things. On to the Linux install...

Labels:

Sunday, June 10, 2007

Log Viewer & XRay

I've made a bunch of changes to LogViewer, you can get the latest package over at:

http://www.rogue-development.com/logViewer.xml

But much more interestingly, I made the changes in direct response for my desire to improve the logging facilities in XRay.

In case you've never heard of it before, XRay is the best tool for debugging Flash applications out there. It's written by a guy named John Grden that I've had the opportunity to work with for the past year or so. Last week I told him about LogViewer and he added it in to XRay. But it just didn't feel right. It looked clunky and there was some functionality that should be there but was missing. So for the past couple days I've been hacking apart LogViewer, adding in a few features, and making it look a little prettier. Here are the results...



As you can see, the search functionality remains, but with a find-previous option listed.

Two new features include the ability to filter based on a text string, and the ability to highlight lines that contain a text string. Both very useful when you have an application spewing large amounts of logging information at you.

With any Luck, we can get these changes wrapped up over the next week to a release-quality state and post it for all to use.

Labels: , , ,

Thursday, June 07, 2007

ObjectHandle component updated

ObjectHandles, the easy way to add user resizing & movement of objects to your flex application, has been updated.

Changes include:

- Initial rotation support added (still needs some tweaks). Thanks
goes to Alexander Kludt for contribution of most of this feature.
- Metadata for events added. (Thanks Thomas Jakobi!)
- Bug fix for making ObjectHandles dynamically through actionscript
instead of in an MXML document.
- Ability to turn mouse cursor support off (since they are ugly right
now).

A new demo is up and downloads can be found at:
http://www.rogue-development.com/objectHandles.xml
(Clear your browser cache before viewing the demo again, I've seen it
not refresh sometimes, even on a shift-reload on my browser)

Enjoy!

Labels: , ,

Open source licenses

I read an article on the GPL over at slashdot today and there were a few pretty insightful comments. One by a guy named MillionthMonkey struck me as particularly insightful.


People focus on the legal issues, but not the simple logistical and psychological issues that arise from the fact that while open source and commercial code may be the work of separate legal entities, in practice both types of code are written and used by the same people, either at home or at work, since hobbyist coders usually have a day job.

At every job I've had, if we're considering incorporating an open source library, the license is the first thing to check. If the project page says GPL we immediately drop the library as a consideration. If it's a commercial license then we can use it but we have to do paperwork for accounting. And if we see BSD, then we right click, download the library, and start looking into it from there. The predictable results of this process: my head fills up with information on the libraries I use, and I forget about the ones I rejected long ago.

Then I get home to my hobby project. Legally, completely different rules apply to me at home. I can release under the GPL (a choice I can't simply make for my employer), use GPL code, etc etc. My own license restrictions as a hobbyist coder are supposedly orthogonal to those at my day job. But guess what? I have to use the same brain at work and at home, it only has so many brain cells to fill up with library APIs, there are only 24 hours in a day, and I barely have time to get drunk as it is. Even though I'm at home I'll probably just build things with stuff I'm familiar with. Especially if I view the library as not being an interesting part of my application.

If my employer used the GPL for projects then I guess I'd be predisposed to use GPL code at home. I've just never worked at a place that incorporated GPL code into its projects, so I'm not familiar with it, and probably won't adopt it.

The GPL is similar to any other proprietary license, from a proprietor it creates that hires anybody, pays nobody, and is legally bound to charge nothing. But it still shares (with the actual authors) proprietary rights to all derivative works because Richard Stallman wanted to confer upon it a competitive advantage enjoyed by other, commercial proprietors. It's a very reasonable proprietary license but in the end that's what it is, and some things should not be proprietary. We still need some public infrastructure in the software industry. Users (including most of you guys) want standard software conventions that always work in a predictable way. They want to leverage their knowledge of GPL software against non-GPL software (or MS software vs. non-MS software) in ways that are totally reasonable- or they say things like "well that's not the way Microsoft does it", "that's not how GNU works", etc. They especially want uninteresting things- like command line parsing, logging, etc. to work in a predictable way. This isn't really served by forcing everyone to implement common infrastructure separately because then users have to learn implementation differences between modules that play common uninteresting roles. These rarely get addressed unless they spoil a sale. Usually they don't; they just annoy users.


While in college and before working in the real world, I was a big supporter of GPL software. Anything I did I released under that license, and I spurned other less "open" licenses.

Lately, I've done nearly no work with GPL software. I might use it as a user, but I no longer use it as a developer. Any open source stuff I write now is MIT licensed. Any open source stuff I hope to use is either BSD or MIT.

When writing a piece of open source software you need to decide what's more important to you.
If you want as many people using it, contributing to it, etc. Choose BSD, MIT, etc.
If you want to make sure nobody ever profits off of your work and any derivative of your work is forever free, choose GPL.

For me, I get more value by having more people using and contributing to my projects. I don't care if the occasional person goes off and makes money off of work I've done.

Labels:

AS3 Drawing API oddity

I have a weird bug that I'm having trouble figuring out. I have the following code:

comp.graphics.clear();
comp.graphics.lineStyle(5, 0x888888);
comp.graphics.moveTo(0,0);
comp.graphics.lineTo(0,50);
comp.graphics.lineStyle(0, 0);
comp.graphics.beginFill(0x188888);
comp.graphics.drawCircle(10,10,5);
comp.graphics.endFill();

I would expect that to draw a vertical grey line with a filled in circle to the right of it. What I actually get is this:



It's like flash is drawing my circle and then doing a flood-fill outside the circle instead of inside it like it should. If I remove the call to drawCircle(), I get similar results but without the circle.

My solution was to draw the line and the circle on different objects, but I'm unclear on why this is necessary.

Labels:

Sunday, June 03, 2007

ObjectHandles now has mouse cursor support.

ObjectHandles, the easy way to add user resizing & movement of objects to your flex application, has been updated.

Now, when mousing over the component or the various handles an appropriate mouse cursor will be displayed.

There's been a lot of interest from people about this component. It's seen over 400 downloads and I've received quite a few emails about it. If you interested in following this project more closely, I've set up a google-group where I plan to announce new versions and people can ask questions. To join, go over to:
http://groups.google.com/group/objecthandles

Downloads, examples, etc can be found on the project page:
http://www.rogue-development.com/objectHandles.xml

If the example on the project page seems out of date, you may have to clear your cache. I've found some browsers don't refresh i-frames like they should.

Labels: , ,

Friday, June 01, 2007

Log Viewer

I've started a new project to make a flex component to quickly display largish amounts of text. It's main purpose is to display logging information on screen. It's uses a semi-intelligent algorithm to re-use on screen components and batch UI updates in groups.


http://www.rogue-development.com/logViewer.xml

Labels: , ,