Archive for the 'tips' Category

Share your CleVR panoramas on Facebook and MySpace.

Sunday, August 31st, 2008

I’m pleased to announce that we’ve been approved by Facebook as a multimedia Share Partner. This means that you can share and display panoramas on Facebook. You can send them as messages and post them to your profile, and they will be displayed properly in the page. Previously you could only send links to the panorama page, but now they can be embedded properly. It’s dead easy to do: just click the Facebook button on any panorama page. There is also a MySpace button that lets you do similar, which has been working for a few weeks now.

Try it out with this one of Beijing Olympic Green, the Birds’ Nest Stadium and Water Cube.

Hiding Flex DataGrid columns using a context menu in AIR

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;