AIR Custom Chrome v.02
Since AIR 1.0 has been released, I have been recieving requests to post an updated version of my AIR Custom Chrome example. I have also added a couple features in this release:
1. Synchronization - This is a pattern that I have been using/ extending on various projects. In short, there is a pop menu that is spawned that allows for various synchronization settings. You will also notice that I have included the various connection states and the appropriate icons & source files. So take a peak and let me know what you think.
2. Window Resizing
That’s about it. Let me know if there are some folks that would like a bit more of an in depth explanation of this approach.

*The “Source” is available by right-clicking and selecting ‘view-source’ in the application.
**This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.

February 27th, 2008 at 4:44 pm
Hi there,
Thanks for sharing this…
Are the two download links off the source page (Flex Trial and source .zip) disabled on intention?
February 27th, 2008 at 10:27 pm
Works now, thanks again for sharing!
March 1st, 2008 at 4:18 am
Hi Bret,
I tried this verson as you requested. When used on a macbook pro with trackpad finger tapping enabled (as described in the blog thread for version 1), this new version 2 still exhibits the strange jumping behaviour. As I said before, this behaviour is not unique to your example.
Jools
March 1st, 2008 at 12:02 pm
Thanks for follow up. I can re-create the bug you are seeing. I will chat with the engineering folks and log a bug for this (if it hasn’t already been captured). I will keep you posted to my findings.
March 4th, 2008 at 8:01 am
There is a little problem with your application: When I type in to search something, if I later change my mind, I cannot select and delete the text using mouse (since clicking the mouse on the TextInput control activates your window-moving function). I haven’t tried to fix it myself, but I just wanted you to know that - it might not be what your users would expect.
- Tom
March 4th, 2008 at 9:49 am
Tom,
There is nothing wrong with the application. This is an example of custom chrome in AIR. If you want to take this example and add features and functionality, thats great. So if you would like to add search functionality, I would suggest focusing on what exactly your searching for first.
March 13th, 2008 at 12:10 pm
Hi Brett
Great that you share your knowledge…thanks.
My question might be stupid but i could’nt find a solution via google
When i try to compile your project in flex builder 3 Win i get the following error:
unable to open ‘E:\server\xampp\htdocs\fex_workspace\CustomWindow02\libs’
what is this path for (libs), and where should it link to?
cheers
martin
March 13th, 2008 at 2:10 pm
ok..problem solved..
March 19th, 2008 at 12:02 pm
Thanks for making this example available. I’d like to suggest that the maximize button should change to a restore button after the application is maximized. The sample application would also perhaps benefit from the standard Windows keyboard shortcut to minimize a window (Win+M.)
April 12th, 2008 at 10:33 am
I’m doing a presentation on data synchronization at FITC Toronto this year. I’ll definitely be pointing people towards this example as a great example of solid data sync design pattern. Thanks for posting it.
May 13th, 2008 at 7:38 pm
Hey, wicked chrome. I used the chrome in a small demo application that I did for a AS3 MySQL driver I am working on. You can check it out here: http://code.google.com/p/assql/
September 28th, 2008 at 8:30 pm
Hey, this “version” of air is great. The suggestion of Mike with the rstor button after the application is maximized is a great idea. I find, that that would make this version more perfect than it is. Thanks for posting this version.
December 6th, 2008 at 7:26 am
thank you very much for chrome
June 14th, 2009 at 9:28 am
Thanks for making this example available. This version is of air great
Cheers Susann
June 14th, 2009 at 7:18 pm
Posts are pretty old but if anybody wants to implement Restore Down functionality, just id your Maximize button (i.e. “maxButton”) and handle it in an AS3 function that you call on the button’s click. Button’s so small that it’ll look fine for both gestures:
//—————————————————————————–
private var maximized:Boolean;
private var winHeight:int;
private var winWidth:int;
private var winX:int;
private var winY:int;
//—————————————————————————–
private function handleMaxOrRestore():void
{
if(!maximized)
{
//Store window’s position and size before maximizing.
winHeight = stage.nativeWindow.height;
winWidth = stage.nativeWindow.width;
winX = stage.nativeWindow.x;
winY = stage.nativeWindow.y;
stage.nativeWindow.maximize()
maximized = true;
maxButton.toolTip = “Restore Down”
}
else
{
//Put window back where it was (size and position) before
//the user maximized.
stage.nativeWindow.height = winHeight;
stage.nativeWindow.width = winWidth;
stage.nativeWindow.x = winX;
stage.nativeWindow.y = winY;
maximized = false;
maxButton.toolTip = “Maximize”
}
}
June 14th, 2009 at 7:21 pm
Oh… and Kudos on the chrome example Brett!
June 22nd, 2009 at 12:44 am
Thanks
November 2nd, 2009 at 10:58 am
Hi can you please create an html and ajax version for adobe air.
Thanks