接下来的例子演示了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>
如对本文有疑问, 点击进行留言回复!!
flash怎么返回上一步? flash撤销操作的三种使用方法
网友评论