开发者

Adobe AIR. Open app from tray with double click

I've used example from here

App doesn't open with double click.

Works

SystemTrayIcon(NativeApplication.nativeApplication.icon).addEventListener(MouseEvent.CLICK, unDock);

Doesn't work

SystemTrayIcon(NativeApplication.native开发者_JAVA技巧Application.icon).addEventListener(MouseEvent.DOUBLE_CLICK, unDock);


As alxx mentioned, this is not a bug, just a limitation.

What you should do is just listen for the click event and compare a the timestamp (getTimer()) between the 2 clicks, if under 400ms, then undock.


Thanks J_A_X. :)

        SystemTrayIcon(NativeApplication.nativeApplication.icon).addEventListener(MouseEvent.CLICK, openWindow);

        private var previousTimeStamp:int;

        private function openWindow(event:Event):void
        {
            var currentTimeStamp:int = getTimer();

            if(currentTimeStamp)
            {
                if(currentTimeStamp - previousTimeStamp < 400)
                {
                    // double click
                    trace("double click");
                }
            }
            previousTimeStamp = getTimer();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜