版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
動畫制作外文翻譯文獻動畫制作外文翻譯文獻(文檔含中英文對照即英文原文和中文翻譯)譯文:動作腳本ActionScript是Macromedia(現已被Adobe收購)為其Flash產品開發(fā)的,最初是一種簡單的腳本語言,現在最新版本3.0,是一種完全的面向對象的編程語言,功能強大,類庫豐富,語法類似JavaScript,多用于Flash互動性、娛樂性、實用性開發(fā),網頁制作和RIA應用程序開發(fā)。ActionScript是一種基于ECMAScript的腳本語言,可用于編寫AdobeFlash動畫和應用程序。由于ActionScript和JavaScript都是基于ECMAScript語法的,理論上它們互相可以很流暢地從一種語言翻譯到另一種。不過JavaScript的文檔對象模型(DOM)是以瀏覽器窗口,文檔和表單為主的,ActionScript的文檔對象模型(DOM)則以SWF格式動畫為主,可包括動畫,音頻,文字和事件處理。歷史在MacOSX10.2操作系統(tǒng)上的MacromediaFlashMX專業(yè)版里,這些代碼可以創(chuàng)建一個與MACOSX啟動過程中看見的類似的動畫。ActionScript第一次以它目前的語法出現是Flash5版本,這也是第一個完全可對Flash編程的版本。這個版本被命名為ActionScript1.0。Flash6通過增加大量的內置函數和對動畫元素更好的編程控制更進一步增強了編程環(huán)境的功能。Flash7(MX2004)引進了ActionScript2.0,它增加了強類型(strongtyping)和面向對象特征,如顯式類聲明,繼承,接口和嚴格數據類型。ActionScript1.0和2.0使用相同的編譯形式編譯成FlashSWF文件(即ShockwaveFlashfiles,或'SmallWebFormat').時間表FlashPlayer2:第一個支持腳本的版本,包括控制時間軸的gotoAndPlay,gotoAndStop,nextFrame和nextScene等動作。FlashPlayer3:增強了載入外部SWF文件的基本腳本支持(loadMovie)。FlashPlayer4:第一個完全實現腳本功能(稱為動作)的播放器。這些腳本擁有簡練的語法和對循環(huán),條件,變量和其它基本語言結構的支持。FlashPlayer5:第一個擁有真正意義上的ActionScript的版本。依據ECMAScript并采用基于原型編程,并允許完全的過程式編程和面向對象編程。FlashPlayer6:增加了事件處理模型,并且支持switch。FlashPlayer7:FlashPlayer7提供一些新特性如支持CSS顯示文本和增強顯示效果。MacromediaFlash編譯器和FlashPlayer7同時支持基于ECMAScript4NetscapeProposal的類編程語言ActionScript2.0。不過ActionScript2.0能交叉編譯成ActionScript1.0的字節(jié)碼,因此它能運行于FlashPlayer6。FlashPlayer8:增加用于運行時圖象數據控制和文件上傳的新類庫及APIs,ActionScript2.0功能更為完善。FlashPlayer8.5(計劃于2006春發(fā)布release版本,currentlyinpublicbeta):增加ActionScript3.0和一個稱為AVM2(ActionScriptVirtualMachine2)新的虛擬機,它可以與前版本AVM1共存以便支持舊內容。增強性能是該版本的主要目標。FlashPlayer92007發(fā)表,這是adobe收購Macromedia后的第一個版本,并且也是MacOSX上第一個Universal版本的FlashPlayer。[1]語言語法在ActionScript2.0類、與函式館物件(如影片片段)可與類聯系在一起。類總寫在外在文件檔案內,并且這些文件必須有.as后綴。類是增設部分──對ActionScrip語言來說,可讓程式員自行開發(fā),雖然有許多內建類譬如MovieClip類──可被用來動態(tài)地在屏幕上畫出向量──已經滿足需求了。類檔案可用來使您編程更加容易,并且類檔案如果需要的話可在許多專案間轉移。FlashActionScript實現的特點如下,JavaScript程式員也許感興趣:一切設計是異步的;callback是普遍存在的,但事件對象不存在。XML的實現從Flash5便存在了。Flash可送和收XML,該項功能可用來透過網絡服務器創(chuàng)造網上多玩者游戲。ActionScript代碼常常直接寫在Flash開發(fā)環(huán)境。該環(huán)境提供參考、代碼提示和句法強調。原代碼常常與電影一起存在.fla檔案里。自外部文件檔透過#include語法導入ActionScript代碼也相當常見。在這種情況下,外部檔案也許被Flash集成開發(fā)環(huán)境內建編譯器,或MotionTwinActionScript2編譯器(MTASC)編譯。參見外部鏈接。評論編程人員們說MacromediaActionScript2.0編譯器有點慢,常常花好幾分鐘才編譯100個類,然而開放源碼編譯器MTASC可以利用;它快多了。ActionScript非常寬大的語法常常讓編程人員們皺眉,因為它常常讓不干凈代碼難以閱讀。在Flash里使用許多向量可能拖慢執(zhí)行許多應用程序的機器的效能,因為Flash每幀每幀重畫每個向量。Flash8引進了cacheAsBitmap變量,它暫時把向量轉換到位圖,這種做法幫助降低了延滯。Flash的ActionScriptVM傾向在觸發(fā)內部的暫停處理前就非??爝_到它的運算極限,特別在麥金塔版的Flash播放器上更嚴重。例如,簡單從1算到5000會威脅某些用戶Flash播放器的能力。在Flash8里許多人不喜歡引入(import)某些類直到要用到那些類前最后一刻。不幸的是,ActionScript3.0相當倚賴引入類,沒有導入撰寫腳本(scripting)實際上不太可能。.swf檔案格式挺容易反組譯,使它非常難以保持源代碼機密。樣本ActionScript2.0樣本下面打印HelloWorld。值得注意的是這只能在整合環(huán)境下執(zhí)行,因為trace函式只有支援整合環(huán)境。trace("Helloworld!");下面代碼利用onMouseMove事件當鼠標移動時輸出現行鼠標位置。同樣的這只有在整合環(huán)境下執(zhí)行。onMouseMove=function(){trace("X:"+_root._xmouse);trace("Y:"+_root._ymouse);};這個較先進的范例創(chuàng)造一個包括數字與字串的陣列,并利用原形函式(prototypefunction)與函式遞歸給變量名num指定一個數,給變量str指定一個字串。然后,利用MovieClip應用程序接口,文字區(qū)域被顯示在屏幕上,文字區(qū)域里頭寫入了變量值。varmy_Array:Array=newArray("Hello","ActionScript",3,7,11,"Flash");Atotype.pickNumber=function():Number{varrand:Number=random(this.length);return(typeof(this[rand])=="number")?this[rand]:this.pickNumber();};Atotype.pickString=function():String{varrand:Number=random(this.length);return(typeof(this[rand])=="string")?this[rand]:this.pickString();};varnum:Number=my_Array.pickNumber();varstr:String=my_Array.pickString();_root.createTextField("txt",1,10,10,530,390);txt.text="Array="+my_Array+"\nRandomNumber="+num+"\nRandomString="+str;ActionScript3.0樣本下面先進的HelloWorld程序目前需要在Flex2.0公開Alpha測試版整合環(huán)境中編譯。package{importflash.display.TextField;importflash.display.MovieClip;importflash.filters.DropShadowFilter;publicclassHelloWorldextendsMovieClip{publicfunctionHelloWorld(){varshad:DropShadowFilter=newDropShadowFilter(2,45,0x000000,25,3,3,2,2);vartxt:TextField=newTextField();txt.textColor=0xFFFFFF;txt.filters=[shad];txt.width=120;txt.x=Math.random()*300;txt.y=Math.random()*300;txt.selectable=false;txt.text="HelloWorld!["+Math.round(txt.x)+","+Math.round(txt.y)+"]";addChild(txt);}}}原文:ActionScriptActionScriptisascriptinglanguagebasedonECMAScript.ActionScriptisusedprimarilyforthedevelopmentofwebsitesandsoftwareusingtheAdobeFlashPlayerplatform(intheformofSWFfilesembeddedintoWebpages),butisalsousedinsomedatabaseapplications(suchasAlphaFive),andinbasicrobotics,aswiththeMakeControllerKit.OriginallydevelopedbyMacromedia,thelanguageisnowownedbyAdobe(whichacquiredMacromediain2005).ActionScriptwasinitiallydesignedforcontrollingsimple2DvectoranimationsmadeinAdobeFlash(formerlyMacromediaFlash).LaterversionsaddedfunctionalityallowingforthecreationofWeb-basedgamesandrichInternetapplicationswithstreamingmedia(suchasvideoandaudio).HistoryActionScriptstartedasascriptinglanguageforMacromedia'sFlashauthoringtool,nowdevelopedbyAdobeSystemsasAdobeFlash.ThefirstthreeversionsoftheFlashauthoringtoolprovidedlimitedinteractivityfeatures.EarlyFlashdeveloperscouldattachasimplecommand,calledan"action",toabuttonoraframe.Thesetofactionswasbasicnavigationcontrols,withcommandssuchas"play","stop","getURL",and"gotoAndPlay".WiththereleaseofFlash4in1999,thissimplesetofactionsbecameasmallscriptinglanguage.NewcapabilitiesintroducedforFlash4includedvariables,expressions,operators,ifstatements,andloops.Althoughreferredtointernallyas"ActionScript",theFlash4usermanualandmarketingdocumentscontinuedtousetheterm"actions"todescribethissetofcommands.TimelinebyplayerFlashPlayer2:Thefirstversionwithscriptingsupport.ActionsincludedgotoAndPlay,gotoAndStop,nextFrameandnextScenefortimelinecontrol.FlashPlayer3:ExpandedbasicscriptingsupportwiththeabilitytoloadexternalSWFs(loadMovie).FlashPlayer4:Firstplayerwithafullscriptingimplementation(calledActions).Thescriptingwasaflashbasedsyntaxandcontainedsupportforloops,conditionals,variablesandotherbasiclanguageconstructs.FlashPlayer5:IncludedthefirstversionofActionScript.Usedprototype-basedprogrammingbasedonECMAScript,andallowedfullproceduralprogrammingandobject-orientedprogramming.FlashPlayer6:Addedaneventhandlingmodel,accessibilitycontrolsandsupportforswitch.ThefirstversionwithsupportfortheAMFandRTMPprotocolswhichallowedforondemandaudio/videostreaming.FlashPlayer7:AdditionsincludeCSSstylingfortextandsupportforActionScript2.0,aprogramminglanguagebasedontheECMAScript4NetscapeProposalwithclass-basedinheritance.However,ActionScript2.0cancrosscompiletoActionScript1.0byte-code,sothatitcanruninFlashPlayer6.FlashPlayer8:FurtherextendedActionScript1/ActionScript2byaddingnewclasslibrarieswithAPIsforcontrollingbitmapdataatrun-time,fileuploadsandlivefiltersforbluranddropshadow.ExampleofActionScript2.0runningonMacromediaFlash8.FlashPlayer9(initiallycalled8.5):AddedActionScript3.0withtheadventofanewvirtualmachine,calledAVM2(ActionScriptVirtualMachine2),whichcoexistswiththepreviousAVM1neededtosupportlegacycontent.PerformanceincreaseswereamajorobjectiveforthisreleaseoftheplayerincludinganewJITcompiler.Supportforbinarysockets,E4XXMLparsing,full-screenmodeandRegularExpressionswereadded.ThisisthefirstreleaseoftheplayertobetitledAdobeFlashPlayer.FlashPlayer10(initiallycalledAstro):Addedbasic3Dmanipulation,suchasrotatingontheX,Y,andZaxis,anda3DdrawingAPI.AbilitytocreatecustomfiltersusingAdobePixelBender.SeveralvisualprocessingtasksarenowoffloadedtotheGPUwhichgivesanoticeabledecreasetorenderingtimeforeachframe,resultinginhigherframerates,especiallywithH.264video.ThereisanewsoundAPIwhichallowsforcustomcreationofaudioinflash,somethingthathasneverbeenpossiblebefore.[2]TimelinebyActionScriptversion2000–2003:ActionScript"1.0"WiththereleaseofFlash5inSeptember2000,the"actions"fromFlash4wereenhancedoncemoreandnamed"ActionScript"forthefirsttime.[3]ThiswasthefirstversionofActionScriptwithinfluencesfromJavaScriptandtheECMA-262(ThirdEdition)standard,supportingthesaidstandard'sobjectmodelandmanyofitscoredatatypes.Localvariablesmaybedeclaredwiththevarstatement,anduser-definedfunctionswithparameterpassingandreturnvaluescanalsobecreated.Notably,ActionScriptcouldnowalsobetypedwithatexteditorratherthanbeingassembledbychoosingactionsfromdrop-downlistsanddialogboxcontrols.Withthenextreleaseofitsauthoringtool,FlashMX,anditscorrespondingplayer,FlashPlayer6,thelanguageremainedessentiallyunchanged;therewereonlyminorchanges,suchastheadditionoftheswitchstatementandthe"strictequality"(===)operator,whichbroughtitclosertobeingECMA-262-compliant.TwoimportantfeaturesofActionScriptthatdistinguishitfromlaterversionsareitsloosetypesystemanditsrelianceonprototype-basedinheritance.Loosetypingreferstotheabilityofavariabletoholdanytypeofdata.Thisallowsforrapidscriptdevelopmentandisparticularlywell-suitedforsmall-scalescriptingprojects.Prototype-basedinheritanceistheActionScript1.0mechanismforcodereuseandobject-orientedprogramming.Insteadofaclasskeywordthatdefinescommoncharacteristicsofaclass,ActionScript1.0usesaspecialobjectthatservesasa"prototype"foraclassofobjects.Allcommoncharacteristicsofaclassaredefinedintheclass'sprototypeobjectandeveryinstanceofthatclasscontainsalinktothatprototypeobject.2003–2006:ActionScript2.0Thenextmajorrevisionofthelanguage,ActionScript2.0,wasintroducedinSeptember2003withthereleaseofFlashMX2004anditscorrespondingplayer,FlashPlayer7.Inresponsetouserdemandforalanguagebetterequippedforlargerandmorecomplexapplications,ActionScript2.0featuredcompile-timetypecheckingandclass-basedsyntax,suchasthekeywordsclassandextends.(Whilethisallowedforamorestructuredobject-orientedprogrammingapproach,thecodewouldstillbecompiledtoActionScript1.0bytecode,allowingittobeusedontheprecedingFlashPlayer6aswell.Inotherwords,theclass-basedinheritancesyntaxwasalayerontopoftheexistingprototype-basedsystem.)WithActionScript2.0,developerscouldconstrainvariablestoaspecifictypebyaddingatypeannotationsothattypemismatcherrorscouldbefoundatcompile-time.ActionScript2.0alsointroducedclass-basedinheritancesyntaxsothatdeveloperscouldcreateclassesandinterfaces,muchastheywouldinclass-basedlanguagessuchasJavaandC++.ThisversionconformedpartiallytotheECMAScriptFourthEditiondraftspecification.2006–today:ActionScript3.0InJune2006,ActionScript3.0debutedwithAdobeFlex2.0anditscorrespondingplayer,FlashPlayer9.ActionScript3.0wasafundamentalrestructuringofthelanguage,somuchsothatitusesanentirelydifferentvirtualmachine.FlashPlayer9containstwovirtualmachines,AVM1forcodewritteninActionScript1.0and2.0,andAVM2forcontentwritteninActionScript3.0.Actionscript3.0addedlimitedsupportforhardwareacceleration(DirectX,OpenGL).Theupdatetothelanguageintroducedseveralnewfeatures:Compile-timeandruntimetypechecking—typeinformationexistsatbothcompile-timeandruntime.Improvedperformancefromaclass-basedinheritancesystemseparatefromtheprototype-basedinheritancesystem.Supportforpackages,namespaces,andregularexpressions.Compilestoanentirelynewtypeofbytecode,incompatiblewithActionScript1.0and2.0bytecode.RevisedFlashPlayerAPI,organizedintopackages.UnifiedeventhandlingsystembasedontheDOMeventhandlingstandard.IntegrationofECMAScriptforXML(E4X)forpurposesofXMLprocessing.DirectaccesstotheFlashruntimedisplaylistforcompletecontrolofwhatgetsdisplayedatruntime.CompletelyconformingimplementationoftheECMAScriptfourtheditiondraftspecification.FlashLiteFlashLite1.0:FlashLiteistheFlashtechnologyspecificallydevelopedformobilephonesandconsumerelectronicsdevices.SupportsFlash4ActionScript.FlashLite1.1:Flash4ActionScriptsupportandadditionaldeviceAPIsadded.FlashLite2.0and2.1:AddedsupportforFlash7ActionScript2.0andsomeadditionalfscommand2API.FlashLite3:AddedsupportforFlash8ActionScript2.0andalsoFLVvideoplayback.SyntaxActionScriptcodeisfreeformandthusmaybecreatedwithwhicheveramountorstyleofwhitespacethattheauthordesires.ThebasicsyntaxisderivedfromECMAScript.ActionScript2.0Thefollowingcode,whichworksinanycompliantplayer,createsatextfieldatdepth0,atposition(0,0)onthescreen(measuredinpixels),thatis100pixelswideandhigh.Thenthetextparameterissettothe"Hello,world!"string,anditisautomatical
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 如皋農村婚慶酒店合同范例
- 出租集裝箱租賃合同范例
- 商洛房屋出售合同范例
- 政府醫(yī)療采購合同范例
- 嫁接樹木合同范例
- 燈飾開關銷售合同范例
- 廢品金屬回收合同范例
- 個人高額借錢合同范例
- 銅仁幼兒師范高等??茖W校《數據庫原理及應用SQL-Server》2023-2024學年第一學期期末試卷
- 完整版100以內加減法混合運算4000道129
- 廣州英語小學六年級英語六上冊作文范文1-6單元
- 低代碼開發(fā)智慧樹知到期末考試答案章節(jié)答案2024年南華大學
- 2024年春季國開《學前教育科研方法》期末大作業(yè)(參考答案)
- 一+《展示國家工程++了解工匠貢獻》(教學課件)-【中職專用】高二語文精講課堂(高教版2023·職業(yè)模塊)
- 概率論與數理統(tǒng)計智慧樹知到課后章節(jié)答案2023年下中國農業(yè)大學
- 2023年9月新《醫(yī)療器械分類目錄》-自2023年8月1日起施行
- 溫州市房屋租賃合同-通用版
- 醫(yī)源性冠狀動脈夾層的識別與防治
- 空心薄壁墩翻模施工技術交底(修改)
- 村級防震地震應急預案
- 關于加強漢壽縣宗祠管理與利用的調研報告
評論
0/150
提交評論