flash外文翻译 英文文献 外文文献.doc
《flash外文翻译 英文文献 外文文献.doc》由会员分享,可在线阅读,更多相关《flash外文翻译 英文文献 外文文献.doc(10页珍藏版)》请在三一办公上搜索。
1、动作脚本,摘自自维基百科,自由的百科全书2009年5月10ActionScriptDesigned by Gary Grossman1998年9月 英文译文: 动作脚本ActionScript是 Macromedia(现已被Adobe收购)为其Flash产品开发的,最初是一种简单的脚本语言,现在最新版本3.0,是一种完全的面向对象的编程语言,功能强大,类库丰富,语法类似JavaScript,多用于Flash互动性、娱乐性、实用性开发,网页制作和RIA应用程序开发。ActionScript 是一种基于ECMAScript的脚本语言,可用于编写Adobe Flash动画和应用程序。 由于Actio
2、nScript和JavaScript都是基于ECMAScript语法的,理论上它们互相可以很流畅地从一种语言翻译到另一种。不过JavaScript的文档对象模型(DOM)是以浏览器窗口,文档和表单为主的,ActionScript的文档对象模型(DOM)则以SWF格式动画为主,可包括动画,音频,文字和事件处理。 历史 在Mac OS X 10.2操作系统上的Macromedia Flash MX专业版里,这些代码可以创建一个与MAC OS X启动过程中看见的类似的动画。ActionScript第一次以它目前的语法出现是Flash 5版本,这也是第一个完全可对Flash编程的版本。这个版本被命名为
3、ActionScript1.0。Flash 6通过增加大量的内置函数和对动画元素更好的编程控制更进一步增强了编程环境的功能。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, nex
4、tFrame和nextScene等动作。 Flash Player 3:增强了载入外部SWF文件的基本脚本支持(loadMovie)。 Flash Player 4:第一个完全实现脚本功能(称为动作)的播放器。这些脚本拥有简练的语法和对循环,条件,变量和其它基本语言结构的支持。 Flash Player 5:第一个拥有真正意义上的ActionScript的版本。依据ECMAScript并采用基于原型编程,并允许完全的 过程式编程和面向对象编程。 Flash Player 6:增加了事件处理模型,并且支持switch。 Flash Player 7: Flash Player 7 提供一些新特性
5、如支持CSS显示文本和增强显示效果。 Macromedia Flash编译器和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 pub
6、lic beta):增加ActionScript 3.0和一个称为AVM2(ActionScript Virtual Machine 2)新的虚拟机,它可以与前版本AVM1共存以便支持旧内容。增强性能是该版本的主要目标。 Flash Player 9 2007发表,这是adobe收购Macromedia后的第一个版本,并且也是Mac OS X上第一个Universal版本的Flash Player。1 语言语法在ActionScript 2.0 类、与函式馆物件(如影片片段)可与类联系在一起。类总写在外在文件档案内,并且这些文件必须有.as后缀。类是增设部分对ActionScrip语言来说,可
7、让程式员自行开发,虽然有许多内建类譬如MovieClip类可被用来动态地在屏幕上画出向量已经满足需求了。类档案可用来使您编程更加容易,并且类档案如果需要的话可在许多专案间转移。Flash ActionScript实现的特点如下,JavaScript程式员也许感兴趣:一切设计是异步的;callback是普遍存在的,但事件对象不存在。 XML的实现从Flash 5便存在了。Flash可送和收XML,该项功能可用来透过网络服务器创造网上多玩者游戏。 ActionScript 代码常常直接写在Flash开发环境。该环境提供参考、代码提示和句法强调。原代码常常与电影一起存在.fla档案里。自外部文件档透
8、过#include语法导入ActionScript代码也相当常见。在这种情况下,外部档案也许被Flash集成开发环境内建编译器,或Motion Twin ActionScript2编译器(MTASC)编译。参见外部链接。评论编程人员们说Macromedia ActionScript 2.0编译器有点慢,常常花好几分钟才编译100个类,然而开放源码编译器MTASC可以利用;它快多了。 ActionScript非常宽大的语法常常让编程人员们皱眉,因为它常常让不干净代码难以阅读。在Flash里使用许多向量可能拖慢执行许多应用程序的机器的效能,因为Flash每帧每帧重画每个向量。Flash 8引进了c
9、acheAsBitmap 变量,它暂时把向量转换到位图,这种做法帮助降低了延滞。 Flash的ActionScript VM倾向在触发内部的暂停处理前就非常快达到它的运算极限,特别在麦金塔版的Flash播放器上更严重。例如,简单从1算到5000会威胁某些用户Flash播放器的能力。 在Flash 8里许多人不喜欢引入(import)某些类直到要用到那些类前最后一刻。不幸的是,ActionScript 3.0相当倚赖引入类,没有导入撰写脚本(scripting)实际上不太可能。 .swf档案格式挺容易反组译,使它非常难以保持源代码机密。 样本ActionScript 2.0 样本下面打印Hell
10、o World。值得注意的是这只能在整合环境下执行,因为trace函式只有支援整合环境。trace(Hello world!);下面代码利用onMouseMove事件当鼠标移动时输出现行鼠标位置。同样的这只有在整合环境下执行。onMouseMove = function () trace(X: +_root._xmouse); trace(Y: +_root._ymouse);这个较先进的范例创造一个包括数字与字串的阵列,并利用原形函式(prototype function)与函式递归给变量名num指定一个数,给变量str指定一个字串。然后,利用MovieClip应用程序接口,文字区域被显示在
11、屏幕上,文字区域里头写入了变量值。var my_Array:Array = 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:Numbe
12、r = random(this.length); return (typeof (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;ActionScr
13、ipt 3.0 样本下面先进的Hello World程序目前需要在Flex 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, 0x0
14、00000, 25, 3, 3, 2, 2); var txt:TextField = 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); 英文原文:ActionScriptA
15、ctionScript is a scripting language based 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 b
16、asic robotics, as with the Make Controller 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
17、added functionality allowing for the creation 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 vers
18、ions of the Flash authoring tool provided 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 Fl
19、ash 4 in 1999, this simple set of actions 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
20、 the term actions to describe this set 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
21、SWFs (loadMovie). Flash Player 4: First 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
22、prototype-based programming based on ECMAScript, 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 onde
23、mand audio/video streaming. Flash Player 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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- flash外文翻译 英文文献 外文文献 flash 外文 翻译 英文 文献

链接地址:https://www.31ppt.com/p-4018779.html