《ActionScript 3.0概述毕业论文外文翻译.doc》由会员分享,可在线阅读,更多相关《ActionScript 3.0概述毕业论文外文翻译.doc(7页珍藏版)》请在三一办公上搜索。
1、英文原文ActionScript 3.0 ActionScript 3.0 is a powerful, object-oriented programming language that signifies an important step in the evolution of the capabilities of the Flash Player runtime. The motivation driving ActionScript 3.0 is to create a language ideally suited for rapidly building rich Intern
2、et applications, which have become an essential part of the web experience.Earlier versions of ActionScript offered the power and flexibility required for creating truly engaging online experiences. ActionScript 3.0 now further advances the language, providing superb performance and ease of developm
3、ent to facilitate highly complex applications, large datasets, and object-oriented, reusable code bases. With ActionScript 3.0, developers can achieve excellent productivity and performance with content and applications that target Flash Player.ActionScript 3.0 is based on ECMAScript, the internatio
4、nal standardized programming language for scripting. ActionScript 3.0 is compliant with the ECMAScript Language Specification, Third Edition . It also contains functionality based on ongoing work on ECMAScript Edition 4, occurring within the ECMA standards body.ActionScript is executed by the Action
5、Script Virtual Machine (AVM) built into the Flash Player. AVM1, the virtual machine used to execute legacy ActionScript code, powers Flash Player today and makes possible a wide range of interactive media and rich Internet applications.However, developers have started to push AVM1 to its limits; the
6、ir project requirements now demand a major breakthrough. ActionScript 3.0 introduces a new highly optimized ActionScript Virtual Machine, AVM2, which dramatically exceeds the performance possible with AVM1. As a result, ActionScript 3.0 code executes up to 10 times faster than legacy ActionScript co
7、de.The new AVM2 virtual machine is available in Flash Player 9, and will be the primary virtual machine for ActionScript execution going forward. The older AVM1 will continue to be supported by Flash Player for backwards compatibility with existing and legacy content.There are numerous products that
8、 generate content and applications targeted at the Flash Player runtime. Often these products incorporate support for ActionScript to add interactivity and behavior to their output. In the Adobe product family, professional designers and developers might use ActionScript within several tools and ser
9、verssuch as Flash, Flex, and Flash Media Serverto create content and applications for Flash Player. The Flex product family, including the new Eclipse-based Flex Builder 2 IDE, will be the first product line to access the new capabilities of ActionScript 3.0.Goals of ActionScript 3.0We wanted Action
10、Script 3.0 to deliver an improved, consistent programming model; compliance with industry standards; and performance an order of magnitude greater than what we delivered in the past. Although ActionScript 3.0 represents a new programming model for the runtime, it is one that will be familiar to deve
11、lopers with a basic knowledge of object-oriented programming.ActionScript 3.0 is designed to address the following goals: Safety: The language supports type safety so developers can write unambiguous, easily maintainable code. Simplicity: The language is intuitive enough for developers to be able to
12、 read and write programs without constantly consulting a reference manual. Performance: The language enables developers to write complex programs that perform efficiently and responsively. Compatibility: The language provides a short backward and forward compatibility path and a significant overlap
13、with industry standards. ActionScript 3.0 is a dialect of ECMAScript which formalizes the features of ActionScript 2.0, adds the capabilities of ECMAScript for XML (E4X), and unifies the language into a coherent whole.Features of ActionScript 3.0ActionScript 3.0 consists of two parts: the core langu
14、age and the Flash Player API. The core language defines the basic building blocks of the programming language, such as statements, expressions, conditions, loops, and types. The Flash Player API is made up of classes that represent and provide access to Flash Playerspecific functionalityActionScript
15、 3.0 contains a host of powerful new features that can greatly speed the development process. Regular expression support enables a variety of powerful operations on text. ECMAScript for XML (E4X) transforms XML into a native data type, dramatically simplifying XML processing. The new Display List AP
16、I makes working with visual objects far more straightforward and consistent. The standardized DOM event model cements the way those objects talk and respond to each other at runtime. These are only a few of the many new capabilities of ActionScript 3.0.Language featuresActionScript 3.0 brings the co
17、re language aspects of ActionScript 2.0 into compliance with the ECMAScript standard and introduces some areas of new or enhanced functionality. All of these features are discussed in comprehensive detail in the ActionScript 3.0 Language Reference, available in beta version on Adobe Labs.Following i
18、s a high-level summary of the developer benefits and usage of some of the new features.Runtime exceptionsIn ActionScript 2.0, many runtime errors would fail in a graceful but silent fashion. This ensured that Flash Player would not display some inexplicable dialog box, which JavaScript did in early
19、web browsers. On the other hand, this lack of error reporting made it more challenging to debug ActionScript programs. ActionScript 3.0 introduces a variety of runtime exceptions for common error conditions, improving the debugging experience and enabling applications that handle errors robustly. Ru
20、ntime errors can provide stack traces annotated with source file and line number information, helping to pinpoint errors quickly.Runtime typesIn ActionScript 2.0, type annotations were primarily an aid for developers; at runtime, all values were dynamically typed.In ActionScript 3.0, type informatio
21、n is preserved at runtime and utilized for a number of purposes. Flash Player performs runtime type checking, improving the systems type safety. Type information is also used to represent variables in native machine representations, improving performance and reducing memory usage.Sealed classesActio
22、nScript 3.0 introduces the concept of a sealed class. A sealed class possesses only the fixed set of properties and methods that were defined at compile-time; additional properties and methods cannot be added. This makes stricter compile-time checking possible, resulting in more robust programs. It
23、also improves memory usage by not requiring an internal hash table for each object instance. Dynamic classes are also possible using the dynamic keyword.Method closuresEvent handling is simplified in ActionScript 3.0 thanks to method closures, which provide built-in event delegation. In ActionScript
24、 2.0, a closure would not remember what object instance it was extracted from, leading to unexpected behavior when the closure was invoked. The mx.utils.Delegate class was a popular workaround; to use it, you would write code as follows: myButton.addEventListener(click,Delegate.create(this, someMeth
25、od); Delegate.create(this, someMethod) This class is no longer needed because in ActionScript 3.0, a method closure will be generated when someMethod is referenced. The method closure will automatically remember its original object instance. Now, one can simply write:myButton.addEventListener(click,
26、 someMethod);附录:译文ActionScript 3.0概述ActionScript 3.0 演变成一门强大的面向对象的编程语言意味着Flash平台的重大变革。这种变化也意味着 ActionScript 3.0 将创造性地将语言理想地迅速地建立出适应网络的丰富应用程序, 成为丰富网络应用(Rich Internet Application)项目的本质部分。比较早期的ActionScript版本就已经提供了这种要求为创造真实地参与在线体验的力量和灵活性。ActionScript 3.0 将促进和发展这种性能, 提供发展强大表现和舒适的先进的高度复杂应用, 结合大型数据库以及可移值性的
27、面象对象的代码。拥有 ActionScript 3.0,开发者可能达到高效执行效率和表现同一的平台。 ActionScript 3.0 基于ECMAScript, ECMAScript是所有编程语言的国际规范化的语言。ActionScript 3.0 同样遵从ECMAScript语言规范。ActionScript 由嵌入在Flash player的ActionScript虚拟机 (AVM)执行。AVM1, 是执行以前版本的ActionScript的虚拟机, 今天变的更加强大的Flash平台使得可能创造出交互式媒体和丰富的网络应用。然而, AVM1却在挤压着开发者们的极限 他们的项目现在到了要求
28、它变革的时刻了。ActionScript 3.0 带来了一个更加高效的ActionScript 执行虚拟机AVM2,它将彻底的脱胎换骨于AVM1 。 它将意味着, ActionScript 3.0执行效率将比以前的ActionScript执行效率高出至少10倍。新的AVM2 虚拟机将会嵌入于Flash player8.5当中, 它将成为执行ActionScript的首先虚拟机。当然旧的AVM1将继续嵌入在Flash player8.5当中以兼容以前的ActionScript。 有众多的产品把自身的展示和应用表现于Flash player当中,这些产品的动画也经常应用到ActionScript
29、以增加互动和行为表现他们的产品。 在Macromedia 产品家族, 专业设计师和也许使用 ActionScript 在几个产品当中, 譬如Macromedia Flash, Flex,和Flash media servers创造出内容和应用表现在Flash player当中。在Flex2 产品家族, 包括最新的基于Eclipe的Flex Builder 2 IDE,会是系列产品中第一个应用ActionScript 3.0 的新体验的产品。 ActionScript 3.0的目标: 我们需要ActionScript 3.0 提供一个先进的, 与编程模型一致的, 服从业界标准, 以及表现将数量级
30、大于我们过去的执行效能。虽然ActionScript 3.0 代表着Flash平台一个新的编程模型,它也将会是一个让开发者熟悉的基础的面对对象的编程语言。 ActionScript3.0的出现将展现出如下目标: 安全 它支持一定的安全以使得能够让开发者写出明白的, 容易的可维护的代码。 朴素 - 这种语言的直观程度使开发者能够直接读和写项目,而不需要经常参考手册 表现 - 这种语言使开发者写出高效率的和表现性强的复杂项目。 兼容性 - 这种语言抛弃不规范的语言标准以及提供向后兼容以及有意义的交替以符合业界标准。ActionScript 3.0 是规范化了的ActionScript 2.0, 增
31、 加了ECMAScript 其中的XML应用(E4X) ,使得这 种语言融入ECMAScript整体连为一贯。 ActionScript 3.0的特征: ActionScript 3.0 包括二部分: 核心语言和Flash playerAPI 。核心语言用于定义编程语言的结构, 譬如声明, 表示, 条件, 循环, 和类型 。Flash player API是 由一系列精确定义Flash player功能的类组成。ActionScript 3.0 拥有尽可能的挖掘出计算机剩余性能的新特点。规则表示支持使操作性更加强大的XML。 ECMAScript for XML (E4X) 使得XML 成为通
32、用数据类型, 将大大地简化XML 处理。新的Display ListAPI将使虚拟对象更加的协调一致。 规范化的DOM 事件模型使得那些对象的表示和响应结合的更加强劲。当然这些只是ActionScript3.0许多新的体验当中的一部分。actionscript3.0语言特点: ActionScript 3.0 的出现是ActionScript 2.0 的核心语言方面融入ECMAScript 以遵守其标准和引入新的改进的一些功能区域的结合。所有这些特点在ActionScript 3.0 语言参考中都有详细的介绍和讨论,可得到试用版正在Macromedia 实验室。下面是一些其开发者对其方便的地方
33、和用法总结的一些新特点。增强处理运行错误的能力(增强异常处理的能力)应用ActionScript 2.0时, 许多表面上“完美无暇”的运行错误无法得到记载。这使得Flash player无法弹出提示错误的对话框, 就象javascript语言在早期的浏览器中所表现的一样。也就是说, 这些缺少的错误报告使得我们不得不花更多精力去调试ActionScript 2.0程序。ActionScript 3.0 引入在编译当中容易出现的更加广泛的错误的情形, 改进的调试方式使得能够健壮地处置应用项目当中的错误。提示的运行错误提供足够的附注(例出出错的源文件)和以数字提示的时间线, 帮助开发者迅速的定位产生
34、错误的位置。 对运行错误的处理方式(异常处理方式) 在ActionScript 2.0中,运行错误的注释主要提供给开发者一个帮助,所有的帮助方式都是动态的。而在ActionScript且是3.0中, 这些信息将被保存到一定的数量,Flash player将提供时间型检查以提高系统的运行安全。这些信息将记录下来用于监视变量在电脑中的运行情况, 以使得开发者能够让自己的应用项目得到改进以减少对内存的使用。密封的类 ActionScript 3.0 将引入密封的类的概念。在编译时间内的的密封类拥有唯一固定的特征和方法,其它的特征和方法不可能被加入。这使得比较严密的编译时间检查成为可能, 创造出健壮的
35、项目。因而它当然可以提高对内存的使用效率, 因为不需要为每一个对象实例增加内在的杂乱指令。当然动态类依然可以使用只要声明为dynamic的关键字。 代理方式 在ActionScript 3.0中事件处理变的更加简化归功于它的嵌入式代理方式。而在ActionScript 2.0中, 方法关闭后并没有记住什么对象事例引用了它们, 当调用已经关闭的方法时将导致意想不到的后果。 Mx.utils.Delegate 类经常被使用,使用它时, 你写了代码如下:myButton.addEventListener(“click”, Delegate.create(this, someMethod); Delegate.create(this, someMethod) 在AS3.0中,这个类不再需要被引入, 当方法关闭时将自动地记住它的原始对象实例。现在, 你可以简单地写为: myButton.addEventListener(“click”, someMethod);