1、动画制作外文翻译文献动画制作外文翻译文献(文档含中英文对照即英文原文和中文翻译)译文:动作脚本ActionScript是 Macromedia(现已被Adobe收购)为其Flash产品开发的,最初是一种简单的脚本语言,现在最新版本3.0,是一种完全的面向对象的编程语言,功能强大,类库丰富,语法类似JavaScript,多用于Flash互动性、娱乐性、实用性开发,网页制作和RIA应用程序开发。ActionScript 是一种基于ECMAScript的脚本语言,可用于编写Adobe Flash动画和应用程序。 由于ActionScript和JavaScript都是基于ECMAScript语法的,理
2、论上它们互相可以很流畅地从一种语言翻译到另一种。不过JavaScript的文档对象模型(DOM)是以浏览器窗口,文档和表单为主的,ActionScript的文档对象模型(DOM)则以SWF格式动画为主,可包括动画,音频,文字和事件处理。 历史 在Mac OS X 10.2操作系统上的Macromedia Flash MX专业版里,这些代码可以创建一个与MAC OS X启动过程中看见的类似的动画。ActionScript第一次以它目前的语法出现是Flash 5版本,这也是第一个完全可对Flash编程的版本。这个版本被命名为ActionScript1.0。Flash 6通过增加大量的内置函数和对动
3、画元素更好的编程控制更进一步增强了编程环境的功能。Flash 7(MX 2004)引进了ActionScript2.0,它增加了强类型(strong typing)和面向对象特征,如显式类声明, 继承,接口和严格数据类型。ActionScript1.0和2.0使用相同的编译形式编译成Flash SWF文件(即Shockwave Flash files,或 Small Web Format).时间表Flash Player 2:第一个支持脚本的版本,包括控制时间轴的gotoAndPlay, gotoAndStop, nextFrame和nextScene等动作。 Flash Player 3:增
4、强了载入外部SWF文件的基本脚本支持(loadMovie)。 Flash Player 4:第一个完全实现脚本功能(称为动作)的播放器。这些脚本拥有简练的语法和对循环,条件,变量和其它基本语言结构的支持。 Flash Player 5:第一个拥有真正意义上的ActionScript的版本。依据ECMAScript并采用基于原型编程,并允许完全的 过程式编程和面向对象编程。 Flash Player 6:增加了事件处理模型,并且支持switch。 Flash Player 7: Flash Player 7 提供一些新特性如支持CSS显示文本和增强显示效果。 Macromedia Flash编译
5、器和Flash Player 7同时支持基于ECMAScript 4 Netscape Proposal的类编程语言ActionScript 2.0。不过ActionScript 2.0能交叉编译成ActionScript 1.0的字节码,因此它能运行于Flash Player 6。 Flash Player 8:增加用于运行时图象数据控制和文件上传的新类库及APIs,ActionScript 2.0功能更为完善。 Flash Player 8.5(计划于2006春发布release版本,currently in public beta):增加ActionScript 3.0和一个称为AVM2
6、(ActionScript Virtual Machine 2)新的虚拟机,它可以与前版本AVM1共存以便支持旧内容。增强性能是该版本的主要目标。 Flash Player 9 2007发表,这是adobe收购Macromedia后的第一个版本,并且也是Mac OS X上第一个Universal版本的Flash Player。1 语言语法在ActionScript 2.0 类、与函式馆物件(如影片片段)可与类联系在一起。类总写在外在文件档案内,并且这些文件必须有.as后缀。类是增设部分对ActionScrip语言来说,可让程式员自行开发,虽然有许多内建类譬如MovieClip类可被用来动态地在
7、屏幕上画出向量已经满足需求了。类档案可用来使您编程更加容易,并且类档案如果需要的话可在许多专案间转移。Flash ActionScript实现的特点如下,JavaScript程式员也许感兴趣:一切设计是异步的;callback是普遍存在的,但事件对象不存在。 XML的实现从Flash 5便存在了。Flash可送和收XML,该项功能可用来透过网络服务器创造网上多玩者游戏。 ActionScript 代码常常直接写在Flash开发环境。该环境提供参考、代码提示和句法强调。原代码常常与电影一起存在.fla档案里。自外部文件档透过#include语法导入ActionScript代码也相当常见。在这种情
8、况下,外部档案也许被Flash集成开发环境内建编译器,或Motion Twin ActionScript2编译器(MTASC)编译。参见外部链接。评论编程人员们说Macromedia ActionScript 2.0编译器有点慢,常常花好几分钟才编译100个类,然而开放源码编译器MTASC可以利用;它快多了。 ActionScript非常宽大的语法常常让编程人员们皱眉,因为它常常让不干净代码难以阅读。在Flash里使用许多向量可能拖慢执行许多应用程序的机器的效能,因为Flash每帧每帧重画每个向量。Flash 8引进了cacheAsBitmap 变量,它暂时把向量转换到位图,这种做法帮助降低了
9、延滞。 Flash的ActionScript VM倾向在触发内部的暂停处理前就非常快达到它的运算极限,特别在麦金塔版的Flash播放器上更严重。例如,简单从1算到5000会威胁某些用户Flash播放器的能力。 在Flash 8里许多人不喜欢引入(import)某些类直到要用到那些类前最后一刻。不幸的是,ActionScript 3.0相当倚赖引入类,没有导入撰写脚本(scripting)实际上不太可能。 .swf档案格式挺容易反组译,使它非常难以保持源代码机密。 样本ActionScript 2.0 样本下面打印Hello World。值得注意的是这只能在整合环境下执行,因为trace函式只有
10、支援整合环境。trace(Hello world!);下面代码利用onMouseMove事件当鼠标移动时输出现行鼠标位置。同样的这只有在整合环境下执行。onMouseMove = function () trace(X: +_root._xmouse); trace(Y: +_root._ymouse);这个较先进的范例创造一个包括数字与字串的阵列,并利用原形函式(prototype function)与函式递归给变量名num指定一个数,给变量str指定一个字串。然后,利用MovieClip应用程序接口,文字区域被显示在屏幕上,文字区域里头写入了变量值。var my_Array:Array =
11、 new Array(Hello, ActionScript, 3, 7, 11, Flash);Array.prototype.pickNumber = function():Number var rand:Number = random(this.length); return (typeof (thisrand) = number) ? thisrand : this.pickNumber();Array.prototype.pickString = function():String var rand:Number = random(this.length); return (type
12、of (thisrand) = string) ? thisrand : this.pickString();var num:Number = my_Array.pickNumber();var str:String = my_Array.pickString();_root.createTextField(txt, 1, 10, 10, 530, 390);txt.text = Array = +my_Array+nRandom Number = +num+nRandom String = +str;ActionScript 3.0 样本下面先进的Hello World程序目前需要在Flex
13、 2.0公开Alpha测试版整合环境中编译。package import flash.display.TextField; import flash.display.MovieClip; import flash.filters.DropShadowFilter; public class HelloWorld extends MovieClip public function HelloWorld() var shad:DropShadowFilter = new DropShadowFilter(2, 45, 0x000000, 25, 3, 3, 2, 2); var txt:TextF
14、ield = new TextField(); txt.textColor = 0xFFFFFF; txt.filters = shad; txt.width = 120; txt.x = Math.random()*300; txt.y = Math.random()*300; txt.selectable = false; txt.text = Hello World! +Math.round(txt.x)+,+Math.round(txt.y)+; addChild(txt); 原文:ActionScriptActionScript is a scripting language bas
15、ed on ECMAScript. ActionScript is used primarily for the development of websites and software using the Adobe Flash Player platform (in the form of SWF files embedded into Web pages), but is also used in some database applications (such as Alpha Five), and in basic robotics, as with the Make Control
16、ler Kit. Originally developed by Macromedia, the language is now owned by Adobe (which acquired Macromedia in 2005). ActionScript was initially designed for controlling simple 2D vector animations made in Adobe Flash (formerly Macromedia Flash). Later versions added functionality allowing for the cr
17、eation of Web-based games and rich Internet applications with streaming media (such as video and audio).HistoryActionScript started as a scripting language for Macromedias Flash authoring tool, now developed by Adobe Systems as Adobe Flash. The first three versions of the Flash authoring tool provid
18、ed limited interactivity features. Early Flash developers could attach a simple command, called an action, to a button or a frame. The set of actions was basic navigation controls, with commands such as play, stop, getURL, and gotoAndPlay.With the release of Flash 4 in 1999, this simple set of actio
19、ns became a small scripting language. New capabilities introduced for Flash 4 included variables, expressions, operators, if statements, and loops. Although referred to internally as ActionScript, the Flash 4 user manual and marketing documents continued to use the term actions to describe this set
20、of commands .Timeline by playerFlash Player 2: The first version with scripting support. Actions included gotoAndPlay, gotoAndStop, nextFrame and nextScene for timeline control. Flash Player 3: Expanded basic scripting support with the ability to load external SWFs (loadMovie). Flash Player 4: First
21、 player with a full scripting implementation (called Actions). The scripting was a flash based syntax and contained support for loops, conditionals, variables and other basic language constructs. Flash Player 5: Included the first version of ActionScript. Used prototype-based programming based on EC
22、MAScript, and allowed full procedural programming and object-oriented programming. Flash Player 6: Added an event handling model, accessibility controls and support for switch. The first version with support for the AMF and RTMP protocols which allowed for ondemand audio/video streaming. Flash Playe
23、r 7: Additions include CSS styling for text and support for ActionScript 2.0, a programming language based on the ECMAScript 4 Netscape Proposal with class-based inheritance. However, ActionScript 2.0 can cross compile to ActionScript 1.0 byte-code, so that it can run in Flash Player 6. Flash Player
24、 8: Further extended ActionScript 1/ActionScript 2 by adding new class libraries with APIs for controlling bitmap data at run-time, file uploads and live filters for blur and dropshadow. Example of ActionScript 2.0 running on Macromedia Flash 8.Flash Player 9 (initially called 8.5): Added ActionScri
25、pt 3.0 with the advent of a new virtual machine, called AVM2 (ActionScript Virtual Machine 2), which coexists with the previous AVM1 needed to support legacy content. Performance increases were a major objective for this release of the player including a new JIT compiler. Support for binary sockets,
26、 E4X XML parsing, full-screen mode and Regular Expressions were added. This is the first release of the player to be titled Adobe Flash Player. Flash Player 10 (initially called Astro): Added basic 3D manipulation, such as rotating on the X, Y, and Z axis, and a 3D drawing API. Ability to create cus
27、tom filters using Adobe Pixel Bender. Several visual processing tasks are now offloaded to the GPU which gives a noticeable decrease to rendering time for each frame, resulting in higher frame rates, especially with H.264 video. There is a new sound API which allows for custom creation of audio in f
28、lash, something that has never been possible before. 2 Timeline by ActionScript version20002003: ActionScript 1.0 With the release of Flash 5 in September 2000, the actions from Flash 4 were enhanced once more and named ActionScript for the first time.3 This was the first version of ActionScript wit
29、h influences from JavaScript and the ECMA-262 (Third Edition) standard, supporting the said standards object model and many of its core data types. Local variables may be declared with the var statement, and user-defined functions with parameter passing and return values can also be created. Notably
30、, ActionScript could now also be typed with a text editor rather than being assembled by choosing actions from drop-down lists and dialog box controls. With the next release of its authoring tool, Flash MX, and its corresponding player, Flash Player 6, the language remained essentially unchanged; th
31、ere were only minor changes, such as the addition of the switch statement and the strict equality (=) operator, which brought it closer to being ECMA-262-compliant. Two important features of ActionScript that distinguish it from later versions are its loose type system and its reliance on prototype-
32、based inheritance. Loose typing refers to the ability of a variable to hold any type of data. This allows for rapid script development and is particularly well-suited for small-scale scripting projects. Prototype-based inheritance is the ActionScript 1.0 mechanism for code reuse and object-oriented programming. Instead of a class keyword that defines common characteristics of a class,
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1