Flash on Tap
I’ll be speaking at Flash on Tap this October 7-9 in Boston. This should be a great conference: Flash + Beer = Nothing to Fear? Or something. Anyway, the speaker line up is top notch. I’m pretty psyched to be included in such an impressive group. My topic is Five Minute Design Patterns. Description below…
Screw eight minute abbs. We’ll be learning a new design pattern every five minutes in this high-impact non-aerobic session. That’s ten whole patterns: Adapter, Template, Singleton, Factory, Strategy, Facade, Iterator, Command, Bridge, and Composite. Why so many in so little time? Because patterns are used for many things, but, mostly they are used to impress other developers. So volume counts. “Composite your tree structure!”; “Facade those classes!”; “UML your bridge!”; and “Iterate this!” are just some things you might say after you’ve paid a little bit of attention during this session. Feel the burn!
We’ll see if the preso works (I think it will be fun), but, hey, if it doesn’t, what do you care? You get to drink beer.
Formatting the FlexLib Window Shade
Our designer wanted to know how to skin the FlexLib Window Shade, so I put this together. Might be useful to someone. Shows how to set the button property on the Window Shade - but, more generally (and probably more importantly) shows multiple ways to set item renderers. Right click to view source.
Data Grid and ADG Footers
[UPDATE 26 Jun 2008] - view source is now fully functional
I made some enhancements to the DataGrid footer posted in Alex’s Flex Closet. This supports resizing columns, locked columns, and horizontal scrolling. It is also implemented in both the Data Grid and the Advanced Data Grid. Licensed under MIT (which I believe is the do whatever the hell you want license - commercial, non-commercial, sell it unedited to someone (although that would be morally wrong)).
I haven’t tested these very much. If you find a bug, please comment.
Demo here. The functions that calculate the content of the footers are in the main mxml. Right click to view source.
Obama Wins Nomination!
OK - well that’ll be tonight. Hilary’s bringing in her big supporters to New York. Bill’s said that he won’t be involved in a presidential campaign for while. And Obama needs 43 delegates to win. All signs point to yes. I’ve updated the Election Center. Unfortunately the state by state data is totally screwed up (not sure if it’s me or CNN (probably me)), so I commented out that tab. I’ll try to fix that tonight.
103 Delegates Today
Getting near the end - Oregon and Kentucky hold their primaries today. Looks like Clinton will win Kentucky (51 delegates). Obama will win Oregon (52 delegates). And Clinton will continue to smoke the high grade and think she can somehow win. I updated the election center and added a summary tab. The tab contains two charts: a pie chart showing current totals; and a bar chart showing how many delegates each candidate needs to win. Most telling is Clinton needs to win 72% of the remaining delegates to win.
Bridge Pattern
I’ll be giving a talk on the Bridge Pattern at the BFPUG Design Patterns Group(I really need to update that page) this Wednesday (May 7, 2008). As always, it’ll take place at Brightcove and will start at 7pm. And as always, we will get together for beers afterwards at Characters (which is located beneath Brightcove). Please stop by. These are really fun nights. Map here.
Election Center Update!
Updated the counts and added some more charts. Not perfect, but, better. Here it is. Also, lots of bugs when you resize!
Mississippi Primary
I’ve finally found a way to blog regularly - update primary data. Mississippi data added to the Election Dashboard.
Flex Multiline Button
Posting mostly so I can find this again quickly.
Basically stolen straight from Alex’s Flex Closet, but a button (not radio button), fixed casting, and just included the referenced class in the same file (less flexible, but, more convenient, maybe). Anyway - use just like a button but has multiple lines.
package components.multiLineButton
{
import flash.display.DisplayObject;
import flash.text.TextLineMetrics;
import mx.controls.Button;
import mx.core.IFlexDisplayObject;
import mx.core.mx_internal;
use namespace mx_internal;
public class MultiLineButton extends Button
{
public function MultiLineButton()
{
super();
}
override protected function createChildren():void
{
if (!textField)
{
textField = new NoTruncationUITextField();
textField.styleName = this;
addChild(DisplayObject(textField));
}
super.createChildren();
textField.multiline = true;
textField.wordWrap = true;
textField.width = width;
}
override protected function measure():void
{
if (!isNaN(explicitWidth))
{
var tempIcon:IFlexDisplayObject = getCurrentIcon();
var w:Number = explicitWidth;
if (tempIcon)
w -= tempIcon.width + getStyle("horizontalGap") + getStyle("paddingLeft") + getStyle("paddingRight");
textField.width = w;
}
super.measure();
}
override public function measureText(s:String):TextLineMetrics
{
textField.text = s;
var lineMetrics:TextLineMetrics = textField.getLineMetrics(0);
lineMetrics.width = textField.textWidth + 4;
lineMetrics.height = textField.textHeight + 4;
return lineMetrics;
}
}
}
import mx.core.UITextField;
class NoTruncationUITextField extends UITextField
{
public function NoTruncationUITextField()
{
super();
}
override public function truncateToFit(s:String = null):Boolean
{
return false;
}
}
Election Center Update
It’s worth doing political charts just to have titles like “Election Center Update”. Obama won Wyoming and Mississippi is tomorrow. Anyway, I just added a delegate count comparison page, here.