Thursday, September 25th, 2008
Mike Chambers has posted a comparison between the performance of AS3 arrays and the new Vectors available in Flash Player 10. The results look good: he managed a 60% speedup. This is very exciting for us at CleVR, because of the potential impact it has on the Stitcher in particular. This uses massive Arrays and lots of nested loops which seem to be just the kind of thing that would benefit from this. I haven’t had a chance to do any benchmarking of my own (hard at work on CleVR Pro) but when I do I’ll post another entry.
Posted in Actionscript, Adobe, Adobe AIR, AIR, AS3, CleVR, Flash, Flex, graphics, image processing, math, maths, panoramas, Stitcher, Stitching software | 5 Comments »
Thursday, August 28th, 2008
A Flex/AIR project I’m working on at the moment uses a DataGrid to display a lot of data. There needs to be lots of columns, but this means that the view can be a bit cluttered. What I wanted was an easy for the user to show or hide columns as they prefer. In Cocoa on Mac OS X you can right-click (or ctrl-click) to show a context menu to do this, which seems to be a good way. I thought there may be a way of doing this in Flex, but there didn’t appear to be. It was quite simple to implement and could be useful in lots of cases, so I thought I’d share the code. I put this in a creationComplete handler.
I’ve attached it as a context menu on the DataGrid, but you could also attach it to the header or to a button. I hope it helpful to someone.
var context:NativeMenu = new NativeMenu();
for each (var col:DataGridColumn in myDataGrid.columns){
var menuI:NativeMenuItem = new NativeMenuItem(col.headerText);
menuI.checked = col.visible;
menuI.data = col;
context.addItem(menuI);
}
context.addEventListener(Event.SELECT, function(e:Event):void {
var t:NativeMenuItem = e.target as NativeMenuItem;
t.checked = !t.checked;
t.data.visible = t.checked;
});
myDataGrid.contextMenu = context;
Posted in Actionscript, Adobe, Adobe AIR, AIR, AS3, Flex, tips | 10 Comments »
Sunday, August 17th, 2008
I’ve been trying to track down the source of a bug in the Stitcher. The issue was in the welcome screen, which has states for logging-in, creating a new account etc. The problem was that whenever the login state had been active, moving to another state would throw an error, The supplied DisplayObject must be a child of the caller. After much trial and error I worked out that it was down to the ControlBar that held the login buttons. It seems that the issue is that when Flex adds a controlbar, it doesn’t actually add it as a child of the container in which you place it. This means that when you then try to remove it, it’s in the wrong place. It seems to be related to this bug, which was apparently fixed last year. I’m going to have to produce a minimal version and see if I need to submit a bug report and/or patch.
Anyway, after changing it to use an HBox it’s working. I’ve uploaded a new version of the CleVR Stitcher with that fix and a few others. You can install it from that box in the sidebar (unless you’re reading this via the feed).
Posted in Actionscript, Adobe, Adobe AIR, AIR, AS3, bugs, CleVR, Flash, Flex, MXML, panoramas, Stitcher, Stitching software | No Comments »