欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Flex中通过和Security类中的常量

程序员文章站 2022-05-24 19:30:34
接下来的例子演示了Flex中通过和Security类中的常量(LOCAL_TRUSTED, LOCAL_WITH_FILE, LOCAL_WITH_NETWORK以及REMOTE)对比sandboxType属性,检查应用程序当前安全沙盒设置。... 13-07-03...
接下来的例子演示了flex中通过和security类中的常量(local_trusted, local_with_file, local_with_network以及remote)对比sandboxtype属性,检查应用程序当前安全沙盒设置。
下面是完整代码:
复制代码代码如下:<?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalalign="middle" backgroundcolor="white" creationcomplete="init();"> <mx:script> <![cdata[ private function init():void { switch (security.sandboxtype) { case security.local_trusted: sandboxlabel.text += " (local trusted)"; break; case security.local_with_file: sandboxlabel.text += " (local with file)"; break; case security.local_with_network: sandboxlabel.text += " (local with network)"; break; case security.remote: sandboxlabel.text += " (remote)"; break; } } ]]> </mx:script> <mx:form> <mx:formitem label="security.sandboxtype:" fontsize="16"> <mx:label id="sandboxlabel" text="{security.sandboxtype}" /> </mx:formitem> </mx:form> </mx:application>