Jack's Technical Blog


DispatchTimer

By jack Herrington - Posted on 09 May 2008

I'm not sure why Silverlight 2 doesn't have the normal Timer class. Perhaps it's to keep people from using it instead of Timelines and Storyboards. But, as it turns out, it does have a timer, it's called DispatchTimer and it's in the System.Windows.Threading namespace.

Thermo

By jack Herrington - Posted on 07 May 2008

You should have a look at the Thermo demo from MAX. It looks really good.

Tags

Advanced States

By jack Herrington - Posted on 06 May 2008

Looks like states will be getting more attention in the next release of Flex. Thank goodness. I think states are one of the defining features of Flex, and yet are the most uncovered. We spend so much time talking about the control set that we don't spend enough time covering the entire body of the UI and it's interaction modes with the customer. And that's where states really come in handy.

Book update: The title is now officially 'Getting Started With Flex 3'.

Tags

Introduction To Degrafa

By jack Herrington - Posted on 05 May 2008

Juan Sanchez has a great Introduction to Degrafa up on InsideRIA. Degrafa is well worth the look. It makes building custom graphics in Flex applications a snap. Plus it fits nicely into the framework so that you can do things like use Degrafa for control skinning.

Tags

XBox and XNA

By jack Herrington - Posted on 05 May 2008

I bought an XBox this weekend and built a project in XNA. XNA is Microsoft's game development system for both Windows and XBox. Since it's easier to build on the Windows box I spent most of my time writing the application there, with full access to the .NET stack. I then went to move it over to the XBox to find that the XBox only supports a very small subset of the .NET stack, excluding, most particularly any direct access to networking. This is probably a security measure to avoid viruses on the box. While that is appreciated, it severely limits what legitimate application developers can do.

Don't get me wrong, you can do game-style networking. Very easily, in fact. In fact, I found the whole application building process quite pleasant. Which is remarkable given that I have no previous experience in gaming style graphics APIs, which are vastly different from enterprise UI APIs.

What I find annoying about this, and almost all of device development is how strictly licensed it is. I was looking around for some help with the networking API and found a person who had written a text chat example for XNA. Only to have someone post in the comments that the application violated the EULA for the box. Ugh.

Why is it that I can write any application I want for your desktop or laptop, but when it comes to writing for your video game console or cell phone it's restrictive beyond belief. I still haven't gotten my iPhone development key from Apple, which means that I can write iPhone apps, but I can't actually put them on the phone.

I think that's why I find the Open Screen initiative so appealing. One UI toolkit, available across all the platforms. Hopefully there will be enough popular outcry to get it out there.

For the time being I think I'm going to port my daughter's 'stamper' game to the XBox. It's a kids paint program that I wrote in Flex. She can take characters and place them on the screen, then move them around, type in text blocks, draw with crayons and so on. Well, first I'll check the marketplace to make sure someone hasn't done it already. Then I'll do it.

Tags

First Flex book

By jack Herrington - Posted on 02 May 2008

My first book on Flex is going into production soon. I wrote it so fast that I don't have a title or a contract for it. But it is being published by O'Reilly and is around 150 pages in length. I'm excited to get the first copy in my hands. It's been a while since I've written a new book. More about this as we get closer to print time.
Tags

Open Screen

By jack Herrington - Posted on 02 May 2008

I'm really excited about this Open Screen initiative that Adobe has going. It opens a lot of doors for those of us who have invested a lot of time in Flex and Flash. This movie, in combination with the RSL libraries making it easier than ever to develop lightweight Flash movies in Flex, is going to be killer. This is also an excellent strategic move for Adobe in the face of a more advanced SIlverlight technology stack.
Tags

Degrafa Graph

By jack Herrington - Posted on 01 May 2008

Here is an example bouncy graph that I built using Degrafa. It was a pretty fun little experiment

The code for the Degrafa graph is shown below:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <dg:Surface xmlns:dg="com.degrafa.*" xmlns:geometry="com.degrafa.geometry.*" xmlns:paint="com.degrafa.paint.*"
  3. xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="updateData();">
  4. <mx:Script>
  5. <![CDATA[
  6. import mx.effects.Effect;
  7.  
  8. [Bindable]
  9. public var dataChangeEffect:Effect = null;
  10.  
  11. private var _data:Array = [];
  12.  
  13. private var _scale:Number = 1;
  14.  
  15. public function get scale() : Number {
  16. return _scale;
  17. }
  18.  
  19. public function set scale( newScale:Number ) : void {
  20. _scale = newScale;
  21. updateData();
  22. }
  23.  
  24. public function get data() : Array {
  25. return _data;
  26. }
  27.  
  28. public function set data( newData:Array ) : void {
  29. _data = newData;
  30. if ( initialized )
  31. updateData();
  32. if ( dataChangeEffect != null )
  33. dataChangeEffect.play([this]);
  34. }
  35.  
  36. private function updateData() : void {
  37. var min:Number = Number.MAX_VALUE
  38. var max:Number = Number.MIN_VALUE;
  39.  
  40. for each ( var dp1:Number in _data ) {
  41. min = Math.min( dp1, min );
  42. max = Math.max( dp1, max );
  43. }
  44.  
  45. var ybase:Number = min - ( ( max - min ) * 0.2 );
  46. var yrange:Number = ( max - min ) * 1.4;
  47. var yscale:Number = height / yrange;
  48. var xscale:Number = width / ( _data.length - 1 );
  49.  
  50. var points:Array = [];
  51. points.push( new Point( 0, height ) );
  52. var curx:Number = 0;
  53. for each ( var dp2:Number in _data ) {
  54. points.push( new Point( curx, height - ( ( ( dp2 - ybase ) * yscale ) * _scale ) ) );
  55. curx += xscale;
  56. }
  57. points.push( new Point( width, height ) );
  58. points.push( new Point( 0, height ) );
  59. chartPoly.points = points;
  60. }
  61. ]]>
  62. </mx:Script>
  63. <dg:fills>
  64. <paint:LinearGradientFill id="backfill" angle="90">
  65. <paint:GradientStop color="#000066" />
  66. <paint:GradientStop color="black" />
  67. </paint:LinearGradientFill>
  68. <paint:SolidFill id="solidblack" color="black" />
  69. </dg:fills>
  70. <dg:strokes>
  71. <paint:SolidStroke id="axis" color="#cccccc" weight="2" />
  72. <paint:SolidStroke id="chartstroke" color="#666666" weight="2" />
  73. </dg:strokes>
  74. <dg:graphicsData>
  75. <dg:GeometryGroup>
  76. <geometry:RegularRectangle width="400" height="300" fill="{solidblack}" />
  77. <geometry:Polygon id="chartPoly" fill="{backfill}" stroke="{chartstroke}" />
  78. <geometry:VerticalLine y="0" y1="{height}" stroke="{axis}" />
  79. <geometry:HorizontalLine y="{height}" x="0" x1="{width}" stroke="{axis}" />
  80. </dg:GeometryGroup>
  81. </dg:graphicsData>
  82. </dg:Surface>
Tags

Welcome to my new site

By jack Herrington - Posted on 30 April 2008

This is my new home site. It's where I'll be posting anything about technology. It's the kind of thing a guy like me is supposed to have, but I haven't had it, until today. So, here I am. Jack at Jack Herrington Dot Com.

Tags
Tags