1 Reply Latest reply on Jan 24, 2011 12:59 AM by SunilRana_Gateway

    How to embed icon in dmg of MAC OS in air application?

    SunilRana_Gateway Level 1

      hi

       

      How to embed icon in dmg of MAC OS in air application? while in windows application it working file if  i set <icon> tag in windows application's .xml file.....

       

      Please reply

        • 1. Re: How to embed icon in dmg of MAC OS in air application?
          SunilRana_Gateway Level 1

          solution ::

           

          add this code in windows app of AIR

          <?xml version="1.0" encoding="utf-8"?>

          <mx:WindowedApplication

           

           

          xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" creationComplete="init()" layout="absolute" xmlns:local="*">

           

           

          <mx:VBox>

           

           

          <mx:Label text="Jay Mahadev" fontSize="32" />

           

           

          </mx:VBox>

           

           

          <mx:Script>

          <![CDATA[

           

           

           

          private function init():void

          {

           

           

          if(NativeApplication.supportsDockIcon){

           

          var dockIcon:DockIcon = NativeApplication.nativeApplication.icon as DockIcon;

          NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE,undock);

           

          //dockIcon.menu = createIconMenu();

          }

           

          else if (NativeApplication.supportsSystemTrayIcon){

           

          var sysTrayIcon:SystemTrayIcon = NativeApplication.nativeApplication.icon as SystemTrayIcon;

          sysTrayIcon.tooltip =

          "Stopwatch";

          sysTrayIcon.addEventListener(MouseEvent.CLICK,undock);

           

          //sysTrayIcon.menu = createIconMenu();

          }

          }

           

           

          public function undock(event:Event = null):void{

          stage.nativeWindow.visible =

          true;

          NativeApplication.nativeApplication.icon.bitmaps = [];

          }

          ]]>

           

          </mx:Script>

          </mx:WindowedApplication>

           

          and also in windowapplication.xml

          <?xml version="1.0" encoding="UTF-8"?>

          <application xmlns="http://ns.adobe.com/air/application/1.0">

           

          <icon>

          <image128x128>/icons/128x128.png</image128x128>

          <image48x48>/icons/48x48.png</image48x48>

          <image32x32>/icons/32x32.png</image32x32>

          <image16x16>/icons/16x16.png</image16x16>

          </icon>

           

          </application>

           

          Reference Link :::

          http://www.adobe.com/devnet/air/flash/quickstart/articles/stopwatch_dock_system_tray.html