Feeds:
文章
留言

Archive for 四月 13th, 2008

AIR 視窗置中

AIR 的應用程式描述檔沒有找到起始置中的設定,可透過如下程式置於螢幕中央

<html>
    <head>       
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >   

        <script type=’text/javascript’ language="javascript" src="/lib/AIRIntrospector.js" />
        <script type=’text/javascript’ language="javascript" src="/lib/AIRAliases.js"/>       
        <script type=’text/javascript’ language="javascript" >           
            var ScreenSize = air.Screen.mainScreen.visibleBounds;               
            with(window.nativeWindow){
                x = (ScreenSize.width-bounds.width)/2;
                y = (ScreenSize.height-bounds.height)/2;               
            };
           
        </script>
    </head>

    <body >

    </body>   
</html>

不過仍會看到視窗突然移向中間。不知道有何好方法一開始就置中~

Read Full Post »