Change vs Click in the Flex 3 DataGrid

April 18th, 2008

(related to a tip I found, but for Flex 3 and my own memory…)

In Flex3 you can be notified of changes to selections in your datagrid from using listeners to either the ‘click’ or ‘change’ events, the difference being that if you only listen for click events you won’t be notified when the user navigates or selects with the keyboard (obvious, but confused me for a bit). This seems a shame given Flex’s pretty good handling of keyboard navigation, so unless you only want mouse click events use a ‘change’ handler as standard.

Using a Click Handler:

<mx:DataGrid id="DG1" click="clickHandler(event)"/>
<mx:Script>
  public function clickHandler(event:MouseEvent):void
  {
      someControl.text = event.currentTarget.selectedItem.someDataField;
  } 
</mx:Script>

Using a Change Handler:

<mx:DataGrid id="DG2" change="changeHandler(event)"/>
<mx:Script>
  public function changeHandler(event:Event):void
  {
      someControl.text = event.target.selectedItem.someDataField;
  } 
</mx:Script>

Great Papervision Presentation

March 6th, 2007

If you are looking to get started with Papervision but have no idea where to start, check out this great Breeze presentation of Pelle Klit Christensen’s presentation at the DFUG. He covers the whole process, from setting up your dev environment, through texturing and exporting from 3DSMax, to getting it all running in Papervision. Well worth a watch!

LFPUG Linux Presentation Slides

January 30th, 2007
flinux.jpg

Way back in November last year I did a presentation at the London Flash Platform Usergroup. I ran through a quick intro to Linux, what makes it different, and why you may (or may not) want to try it out, as well as giving a demo of my Beryl desktop.

I also showed how to install the (back then brand new) Beta Linux Flash Player, and how to set up a completely Open Source Flash development environment using Eclipse, MTASC & ASDT.

I had a lot of fun doing the pres, and gave out a whole stack of Ubuntu CD’s afterwards. The slides were supposed to go up on the LFPUG site at the same time as the video, but that all got rather delayed… so I thought I’d post my slides here instead. Better late than never :)


Download “Getting Flash on Linux” presentation slides

(The useful Flash info is from about slide 17 onwards)

Edit - the video is up on the LFPUG site too now, bit dark but check it out

FDT - Templates are your friend!

July 22nd, 2006

Jason Nussbaum suggests on his blog the use of a standard naming convention in all your get and set functions to save you a few seconds thinking time. This is all good, but how about taking it one step further by ensuring you always use standard names while also saving some typing? If you’re using FDT I just might be able to help…

A nifty feature of FDT that not many people seem to know about is Templates. Templates allow you to easily insert and customise chunks of code, anything from one line to whole classes, in a few keystrokes. Being a lazy git at heart I have a lot of love for this feature, and use it often. The best thing is you can also easily make your own Templates to automate your regular tasks, and in this post I’ll show you to add a simple Template to write a pair of ‘get’ & ’set’ data access functions in a record time…

Read the rest of this entry »