`

flash 中的 ApplicationDomain

阅读更多

使用 ApplicationDomain 类 <script src="/_sharedassets/pages.js"></script>

ApplicationDomain

 

ApplicationDomain 类的用途是存储 ActionScript 3.0 定义表。SWF 文件中的所有代码被定义为存在于ApplicationDomain 中。 可以使用应用程序域划分位于同一个安全域中的类。这允许同一个类存在多个定义,并且还允许子级重用父级定义。

 

在使用 Loader 类 API 加载用 ActionScript 3.0 编写的外部 SWF 文件时,可以使用应用程序域。(请注意,在加载图像或用 ActionScript 1.0 或 ActionScript 2.0 编写的 SWF 文件时不能使用应用程序域。)包含在已加载类中的所有 ActionScript 3.0 定义都存储在应用程序域中。加载 SWF 文件时,通过将 LoaderContext 对象的 applicationDomain 参数设置为 ApplicationDomain .currentDomain ,可以指定文件包含在 Loader 对象所在的相同应用程序域中。通过将加载的 SWF 文件放在同一个应用程序域中,可以直接访问它的类。如果加载的 SWF 文件包含嵌入的媒体(可通过其关联的类名称访问),或者您要访问加载的 SWF 文件的方法,则这种方式会很有用。

 

使用 ApplicationDomain 类 <script src="/_sharedassets/pages.js"></script>

使用应用程序域时,还要记住以下几点:

  • SWF 文件中的所有代码被定义为存在于应用程序域中。 主应用程序在"当前域"中运行。"系统域"中包含所有应用程序域(包括当前域),也就是,它包含所有 Flash Player 类。
  • 所有应用程序域(除系统域外)都有关联的父域。主应用程序的应用程序域的父域是系统域。已加载的类仅在其父级中没有相关定义时才进行定义。不能用较新的定义覆盖已加载类的定义

 

 

 

看一下下面这个例子:


使用 ApplicationDomain 类 <script src="/_sharedassets/pages.js"></script>

主应用程序文件为 application1.swf。它包含从其它 SWF 文件加载内容的 Loader 对象。在此方案下,当前域为 Application domain 1。用法 A、用法 B 和用法 C 说明了为应用程序中的每个 SWF 文件设置适当应用程序域的不同方法。

 

 

用法A:

用的不是很多,实际上是单独的创建一个新的域和当前应用程序域平级。作为系统域的真子集。

request.url = "application2.swf";
request.applicationDomain


 = new ApplicationDomain

();

 

 

用法B:

被用作Rsls(运行时共享库)的技术,就是在当前的ApplicationDomain添加新的类定义。

request.url = "module3.swf";
request.applicationDomain = ApplicationDomain.currentDomain;

 

 

用法C:

被用作Modual(模块)技术,就是在当前的ApplicationDomain的真子域,他的特点是可以动态的加载和移除。便于垃圾回收。

request.url = "module3.swf";
request.applicationDomain


 = new ApplicationDomain

(ApplicationDomain

.currentDomain);

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 大小: 76.8 KB
分享到:
评论

相关推荐

    详细介绍ApplicationDomain和SecurityDomain

    详细介绍ApplicationDomain和SecurityDomain的原理,想对这方面的知识做深入研究的可以看下

    Adobe Flash Player for IE v11.3.300.265

    Adobe Flash Player(Flash Player官方下载)是一个集成的多媒体播放器,让你在Web上享受更广泛的多媒体体验。Adobe Flash Player官方版可显示和播放多媒体内容,从数以千计的高度...— ApplicationDomain.getQualifie

    网页FLASH播放器代码

    &lt;script language="JavaScript"&gt; var movie,timer,step,total,state=null,delay=100 function init(){//在 Flash 加载完成后初始化相关变量的函数 ...&lt;embed name="movie" src="http://file.flash8.net/film/...

    Flash插件本地下载

    34. type="application/x-shockwave-flash" 35. &lt;%if(SysDownloadFlashFashion==1){%&gt; 36. pluginspage="http://www.adobe.com/go/getflashplayer" 37. &lt;% }else{%&gt; 38. pluginspage="&lt;%=context%&gt;/...

    asp flash 上传 代码 能显示上传进度

    &lt;embed src="upfile/main.swf" quality="high" bgcolor="#ffffff" width="342" height="38" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=...

    详解flash应用程序域

    读懂flash应用程序域的用法,体会安全沙箱机制。

    AS3-DomainMemoryManager:Adobe AIRFlash中用于域内存访问的管理器

    AS3-DomainMemoryManager 用于在Adobe AIR / Flash中访问域内存的管理器。 该项目是根据MIT许可... DomainMemory的使用存在一些问题: 只能将一个字节数组同时分配给ApplicationDomain.domainMemory 在ApplicationDo

    FLEX 系统管理器 SystemManager

    SystemManager是Flex应用的主控者,它控制着应用窗口,Application实例,弹出窗口,cursors,并管理着ApplicationDomain中的类。SystemManager是FlashPlayer实例化的第一个类,它存储了主应用窗

    flash首页图片.rar

    +button_pos+'&stop_time='+stop_time+'" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=...

    SWFUpload大文件上传系统

    不支持中文文件名,上传文件包含中文文件名将自动删去中文字符(我尝试修改源文件中文件名的正则表达式,但是保存文件名出现了乱码,所以放弃了) 由于时间仓促,我仅汉化了 Simple Upload 的 PHP 版本,本组件的...

    PROGRAMMING ACTIONSCRIPT 3.0

    Using the ApplicationDomain class700 Using the IME class. 704 Example: Detecting system capabilities 709 12 Chapter 24: Printing... 715 Basics of printing..716 Printing a page..718 Flash Player tasks ...

    SSCP.ISC2.Systems.Security.Certified.Practitioner.Official.Study.Guide

    Fully updated Study Guide for the SSCP ...Chapter 9 Domain 7: Systems and Application Security Appendix A Answers to Written Labs Appendix B Answers to Review Questions Appendix C Diagnostic Tools

    asp.net知识库

    在Asp.net中如何用SQLDMO来获取SQL Server中的对象信息 使用Relations建立表之间的关系并却使用PagedDataSource类对DataList进行分页 通过作业,定时同步两个数据库 SQLSERVER高级注入技巧 利用反射实现ASP.NET控件和...

    Spring Recipes A Problem-Solution Approach [英文原版]

    One of the first (if not the ... Frameworks built on top of the Spring framework have emerged supporting application integration, batch processing, Flex and Flash integration, GWT, OSGi, and much more.

    可控制切换显示图片,js代码

    &lt;SCRIPT type=text/javascript&gt;var pic_width=331;...type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /&gt;');document.write('&lt;/object&gt;');&lt;/SCRIPT&gt;

    赛尔号发包例子以及逆向过程-易语言

     this._loader.loadBytes(byteArray,new LoaderContext(false,ApplicationDomain.currentDomain));  } 思路清晰,可以干代码,这里使用了易语言 导出文件 可以,再将其导入FFdec看看效果。解压后,开始找与通讯的...

    ASP网页幻灯片代码另类

    type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" /&gt;'');" Response.Write "document.write(''&lt;/object&gt;'');" Response.Write "&lt;/SCRIPT&gt;" rs.close set rs...

    数据库系统概念Database System Concept(英文第6版)文字版

    6.3 The Domain Relational Calculus 245 6.4 Summary 248 Exercises 249 Bibliographical Notes 254 Chapter 7 Database Design and the E-R Model 7.1 Overview of the Design Process 259 7.2 The Entity-...

    WordPress 3 Search Engine Optimization.pdf

    Flash, JavaScript, image links, and other non-readable content 248 Poor site architecture 250 Table of Contents [ viii ] Expert site architecture with manual links and PageRank sculpting 251 Over-...

    spring-framework-reference4.1.4

    Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................

Global site tag (gtag.js) - Google Analytics