主角:adobe.utils.ProductManager;
MXML文件:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init();">
<fx:Declarations>
</fx:Declarations>
<fx:Script source="Main1.as"/>
</s:WindowedApplication>
运用一:判断客户机AIR的安装及环境
Main1.as:
import adobe.utils.ProductManager;
private function getStatus():String
{
var hasAIR:ProductManager=new ProductManager("airappinstaller");
if (hasAIR.installed)
{
return "installed";
}
else
{
var os:String=Capabilities.os;
if (os == "Windows 95" || os == "Windows 98/ME")
{
return "unavailable";
}
if (os.indexOf("Mac OS 10.0") == 0 || os.indexOf("Mac OS 10.1") == 0 || os.indexOf("Mac OS 10.2") == 0 || os.indexOf("Mac OS 10.3") == 0)
{
return "unavailable";
}
if (os.indexOf("Windows") == 0 || os.indexOf("Mac OS 10") == 0 || os.indexOf("Linux") == 0)
{
return "available";
}
return "unavailable";
}
}
private function init():void
{
switch (getStatus())
{
case "installed":
trace("已经安装AIR运行时");
break;
case "unavailable":
trace("当前系统无法安装AIR运行时");
break;
case "available":
trace("尚未安装AIR运行时");
break;
}
}
运用二:重启运用程序
Main2.as:
[注:]本例运用,需在app.xml中把
<allowBrowserInvocation>true</allowBrowserInvocation>
import adobe.utils.ProductManager;
import flash.events.MouseEvent;
import mx.core.FlexGlobals;
import spark.components.Button;
import spark.components.WindowedApplication;
private function init():void
{
var restartBtn:Button=new Button();
restartBtn.x= restartBtn.y=114;
restartBtn.label="重启系统"
this.addElement(restartBtn)
restartBtn.addEventListener(MouseEvent.CLICK, doRestartAppHandler)
}
private function doRestartAppHandler(event:MouseEvent):void
{
var app:WindowedApplication=WindowedApplication(FlexGlobals.topLevelApplication);
var mgr:ProductManager=new ProductManager("airappinstaller");
mgr.launch("-launch " + app.nativeApplication.applicationID + " " + app.nativeApplication.publisherID);
app.close();
}
分享到:
相关推荐
ProductManager.rarProductManager.rarProductManager.rar
Cracking the PM Interview How to Land a Product Manager Job in Technology
如何做产品经理,从产品企划,开发,到市场,是一本产品经理手册。
ProductManager.rarProductManager.rar
ProductManager
《产品经理》 The.Internet.Product.Manager.S01E02.第一季第二集
《产品经理》 The.Internet.Product.Manager.S01E01.第一季第一集 《产品经理》 The.Internet.Product.Manager.S01E01.第一季第一集
深度解析一个好的产品经理必须具备的素质!
Digital Product Manager是一个PHP脚本,它允许PayPal IPN集成以便出售文件,包括一个管理中心,该管理中心可以跟踪并编辑所有产品和价格。 它会遮盖产品网址以保护您的文件。
productManager
《THE PRODUCT MANAGER’S DESK REFERENCE》是产品经理必读书籍之一
ProductManager2
m4l6-ProductManager-JPA
ProductManager:无缝连接Colin Sidberry与产品经理
Opencart-产品经理 Opencart产品经理
一款产品管理应用。Product Manager Mac版可以让你从不同的角度管理公司的产品。它是基于文档的,可以管理无限数量的文档,每个文档都有无限数量的产品,按家庭细分。
Cloudera Manager API v32 Introduced in Cloudera Manager 6.2.0 Cloudera Product Documentation
产品经理产品经理应用程序、php、mysql、angular
使用Java 11 Springboot 2.4.4的REST Web服务样例JPA MySQL Redis缓存 log4j2