So this falls into the pretty obvious category, but as I had not tried it before I wanted to confirm it would work. Yesterday I noticed that my FTP program (FileZilla - has both a client and a server and is free - very recommended!) changed the application title based on what server I was connected to. This gave me a bit of context about what the application was up to. As an example, here is what FileZilla looks like in my task bar after I've connected to my web server.
Yeah, not rocket science but interesting. I figured this would be trivial in an Adobe AIR application so I whipped up the following simple example.
$("#button1, #button2, #button3").click(function() {
var label = $(this).attr("value");
window.document.title = label + " - MyApp";
});
});
</script>
</head> <body>
<input type="button" id="button1" value="Test One">
<input type="button" id="button2" value="Test Two">
<input type="button" id="button3" value="Test Three"> </body>
</html>
<html>
<head>
<title>MyApp</title>
<script type="text/javascript" src="lib/air/AIRAliases.js"></script>
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js"></script>
<script>
$(document).ready(function() {
The application consists of three simple buttons. Whenever you click one, I use a jQuery event handler to pick up the label and use it to update the window title. That's the same code you would use to update the title of your browser (something I explored a while back in this blog entry) and it works the exact same for AIR as well. Here is a simple screen shot after clicking button two.
Yeah - not too terribly exciting but hey - I was curious. :)