Updating an HTML/Adobe AIR Application Title

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.

<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() {

        $("#button1, #button2, #button3").click(function() {
            var label = $(this).attr("value");
            window.document.title = label + " - MyApp";

    &lt;input type="button" id="button1" value="Test One"&gt; 
    &lt;input type="button" id="button2" value="Test Two"&gt; 
    &lt;input type="button" id="button3" value="Test Three"&gt; 



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. :)

Like This?

If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can also subscribe to the email feed to get notified of new posts.