用flashbuilder建立和发布air程序心得

2010-04-24 22:02

一,发布时数字证书问题

这两天没事,然后自己研究了下air程序的建立和发布。建立air程序很简单,就不赘言。想在这里分享大家的是air的发布心得。

建立完air工程后,本以为发布很简单,可到发布的时候,傻眼了,adobe强制要求发布证书,后来在网上搜了一下,证书分为两种,一种是Adobe认证的正式证书;一种是自己制作的非正式证书。正式证书的好处是发布的程序有正式的发布商名称,让用户使用放心。另一种非正式证书只是便于个人用户调试发布个人程序。一般开发者使用个人证书就可以了。下面说说个人证书的制作方法。

air个人数字证书制作流程:

1。新建一文本文件:

2。 输入一下内容:

@echo off

:: AIR certificate generator
:: More information:
:: http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_5.html#1035959
:: http://livedocs.adobe.com/flex/3/html/distributing_apps_4.html#1037515

:: Path to Flex SDK binaries
set PATH=%PATH%;D:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\bin

:: Certificate information
set NAME=AIRCertificate
set PASSWORD=fd
set CERTIFICATE=AIRCertificate.pfx

call adt -certificate -cn %NAME% 1024-RSA %CERTIFICATE% %PASSWORD%
if errorlevel 1 goto failed

echo.
echo Certificate created: %CERTIFICATE%
echo With password: %PASSWORD%
echo.
echo Hint: you may have to wait a few minutes before using this certificate to build your AIR application setup.
echo.
goto end

:failed
echo.
echo Certificate creation FAILED.
echo.
echo Troubleshotting: did you configure the Flex SDK path in this Batch file?
echo.

:end
pause

(绿色一行改成自己sdk的bin目录,红色一行fd可以换成自己的密码)

3。 修改文本后缀名为bat,建立批处理文件。

这样双击该文件就可以为你生成个人数字证书了。

二,使用纯as3写air程序

使用纯as3写air好处显而易见,就是体积小。具体办法是,建立air工程后,删除***.mxml文件,然后建立一个同名的as文件,设为默认编译。并在程序初始化时设置stage.nativeWindow.visible = true;

三,自定义air主窗体外观

办法是找到工程生成的***-app.xml,并找到

<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
<!--   <systemChrome></systemChrome> -->

修改为

<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
   <systemChrome>none</systemChrome>

这样系统窗口就隐藏了。剩下窗口的样式就有你做主了,嘎嘎

更详细的自定义窗口方法大家可以参考:

AIR的窗口外观修饰:http://www.68design.net/Web-Guide/Flash/46381-1.html

自定义窗口的外观:http://www.adobe.com/cn/devnet/air/ajax/quickstart/custom_chrome.html

原文地址:https://www.cnblogs.com/crkay/p/1747964.html