Weekly Developer Journal : July 17th – July 23rd

Sunday, July 23rd

8:19pm The @media CSS shortcuts for mobile development are

@media ( os-platform: "Android" ) {}
@media ( os-platform: "QNX" ) {} /* Who cares */
@media ( os-platform: "IOS" ) {}

@media ( application-dpi: "160" ) {}
@media ( application-dpi: "240" ) {}
@media ( application-dpi: "320" ) {}

From @JosephLabrecque‘s presentation slides Adapting Expectations to Fit a Mobile Workflow.

Wednesday, July 27th

10:04 am There are many subtle differences between SQLite in AIR and MySQL. One of them is that empty fields in MySQL usually return default values like an empty string for fields that have no data. But SQLite returns null. That can really screw up your code if your looking for “” and find null.

9:40 pm JudahFrangipane has a brilliant solution to allowing for component overlays of the StageWebView.

 Thursday, July 28th

10:03am Doing mostly fit-and-polish work on the RunPee app today. I think most of the new features I’m going to add for this update are complete.

10:29am I’m using an ActionScript ItemRenderer for the movies list in the RunPee nav. So I don’t get the automatic “…” at the end of a line of text that is truncated. Here’s the code I used to manually do that for TextFields:

var count : int = 1;
if( _movieField.textWidth > TRON.APP_WIDTH - 5 ) {
	while( _movieField.textWidth > TRON.APP_WIDTH - 20 ) {
		_movieField.text = _movieVO.title.substring( 0, _movieVO.title.length - count );
		count ++;
	}
	_movieField.appendText( '...' );
}

It just looks at the length of the textWidth to see if it is wider than the APP_WIDTH minus a bit of padding. If so then it runs through and removes a character at a time until it will fit and then appends the “…” at the end. This is running inside an ItemRenderer but it’s something that only happens rarely.

 1:51pm I love the power of Flex 4/Spark component skinning model but it’s a real pain in the ass when all you want to do is change the border color of a TextInput on focus. It took some searching but I found a nice solution from the Flexponential guys. This not only shows you how to do the simple changing of the border color on the TextInput when it’s focused but also gets a little fancy with examples showing gradients and dotted lines and animations. Great work guys.