The following example shows how you can display custom icons in an Adobe AIR application by setting the <icon> node in the AIR application’s descriptor XML file.

Full code after the jump.



    assets/AppIcon16.png
    assets/AppIcon32.png
    assets/AppIcon48.png
    assets/AppIcon128.png

application_XML_icon_test srcview

Tagged with:
 

10 Responses to Displaying custom icons in an Adobe AIR application

  1. Tomas Sancio says:

    Thank you very much! Helped me a lot.

  2. Brentski says:

    Your paths are different here. “/assets/” and “assets/”

    Much confusion may be caused by such little things.

  3. Arulraj says:

    for me… air.xml(29): error 105: application.icon.image16x16 contains an invalid value

    how to resolve this… can anyone help me out…

  4. Arulraj says:

    assets\icon_016.png
    assets\icon_032.png
    assets\icon_048.png
    assets\icon_128.png

    this is my file.. i m working in windows..

  5. chary says:

    Thanks so much your article. I lost 2 days for this. I think it is so easy but it make me tired. Thanks when I meet your article!

    — chary1112004 —

  6. Trechix says:

    My descriptor file reads as follows:

    examples.html.SeaKing
    0.1
    SeaKing

    index.html
    true
    855
    590

    And after reading this article, i’ve written the following to put in my XML descriptor file:

    /assets/App_16.png
    /assets/App_32.png
    /assets/App_48.png
    /assets/App_128.png

    I’m 100% sure everything’s correct, including the image paths. But I’m not sure where in the XML file to put this–whatever I try never shows up when I test it out. Any help?

  7. Gregg Sorola says:

    Just preferred to say that you’ll have some helpful articles in your website online. You have accomplished a extremely good employment with this one particular. Thanks!

  8. Wilson Oto says:

    I’ve eventually identified a regular presentation on this matter. Thank you

  9. andrey says:

    Two days of trying to implement the icon does not work.
    Only after the export in .air will be displayed. (This is not mentioned anywhere in the help that in order to display the icon you want to create .air!!!!!

  10. Alex says:

    andrey: use

    in XML:

    icons/16.png
    icons/32.png
    icons/48.png
    icons/128.png

    and in program:
    if (NativeApplication.supportsSystemTrayIcon) {
    icon.load(new URLRequest(“icons/16.png”));

    }

    if (NativeApplication.supportsDockIcon){

    icon.load(new URLRequest(“icons/128.png”));

    }

Leave a Reply

Your email address will not be published.