ActionScript: Difference between revisions

Content deleted Content added
m Added links.
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5) (Eastmain - 23915
 
(8 intermediate revisions by 6 users not shown)
Line 3:
{{Use mdy dates|date=April 2013}}
{{Infobox programming language
| name = ActionScript
| logo = ActionScript icon.png
| paradigm = [[Multi-paradigm]]: [[Object-oriented programming|object-oriented]] ([[prototypePrototype-based programming|prototype-based]]), [[functionalFunctional programming|functional]], [[imperativeImperative programming|imperative]], [[scriptingScripting language|scripting]]
| family = [[ECMAScript]]
| year = 1998
| designer = [[Gary Grossman]]
| developer = [[Macromedia]] (now dissolvedmerged into [[Adobe Inc.|Adobe Systems]], 2005)
| released = {{Start date and age|1998}}
| latest_release_version = 3.0
| latest release version = 3.0
| latest_release_date = {{start date|2006|06|27}}
| latest release date = {{Start date and age|2006|06|27}}
| typing = [[strongStrong and weak typing|strong]], [[static typing|static]]
| implementations = [[Adobe Flash Player]], [[Adobe AIR]], [[Apache Flex]], [[Scaleform GFx]]
| influenced_byimplementations = [[Adobe Flash =Player]], [[HyperTalkAdobe AIR]], [[JavaScriptApache Flex]], [[Java (programmingScaleform language)|JavaGFx]]
| scope = [[Scope (computer science)|lexical]]
| influenced = [[Haxe]], [[TypeScript]]<ref>{{Cite web |last=Nelson |first=Gary |date=28 April 2020 |title=How ActionScript foreshadowed TypeScript |url=https://javascript.plainenglish.io/how-actionscript-foreshadowed-typescript-149cdb764de9 |access-date=9 July 2022 |website=Medium |language=en}}</ref>
| influenced by = [[HyperTalk]], [[JavaScript]], [[Java (programming language)|Java]]
| website = [https://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html adobe.com/devnet/actionscript/]
| influenced = [[Haxe]], [[TypeScript]]<ref>{{Cite web |last=Nelson |first=Gary |date=28 April 2020 |title=How ActionScript foreshadowed TypeScript |url=https://javascript.plainenglish.io/how-actionscript-foreshadowed-typescript-149cdb764de9 |access-date=9 July 2022 |website=Medium |language=en}}</ref>
}}
{{Infobox file format
| name = ActionScript
| extension = .as
| mime = application/ecmascript<ref>{{IETF RFC|4329}} (limit compatible with EcmaScriptECMAScript)</ref>
}}
 
'''ActionScript''' is an [[objectObject-oriented programming|object-oriented]] [[programming language]] originally developed by [[Macromedia|Macromedia]] Inc.]] (later acquired by [[Adobe Inc.|Adobe]]). It is influenced by [[HyperTalk]], the scripting language for [[HyperCard]].<ref>{{cite web|url=http://www.zdnet.com/blog/government/apples-lost-decade-hypercard-and-what-might-not-have-been-if-apple-then-was-like-apple-is-today/10185|archive-url=https://web.archive.org/web/20110421072519/http://www.zdnet.com/blog/government/apples-lost-decade-hypercard-and-what-might-not-have-been-if-apple-then-was-like-apple-is-today/10185|url-status=dead|archive-date=April 21, 2011|title=Apple's lost decade, HyperCard, and what might NOT have been if Apple then was like Apple is today|work=[[ZDNet]]|date=2011-04-17|access-date=2014-12-04}}</ref> It is now an implementation of [[ECMAScript]] (meaning it is a superset of the syntax and semantics of the language more widely known as [[JavaScript]]), though it originally arose as a sibling, both being influenced by [[HyperTalk]]. ActionScript code is usually converted to byte-code[[bytecode]] format by a [[compiler]].
 
ActionScript is used primarily for the development of websites and software targeting the [[Adobe Flash]] platform, originally finding use on [[web page]]s in the form of embedded [[SWF]] files.
 
ActionScript 3 is also used with the [[Adobe AIR]] system for the development of desktop and mobile applications. The language itself is [[open-source]] in that its specification is offered free of charge<ref>{{Cite web |url=http://help.adobe.com/livedocs/specs/actionscript/3/wwhelp/wwhimpl/js/html/wwhelp.htm |title=ActionScript 3 Language Specification |access-date=November 12, 2016 |archive-url=https://web.archive.org/web/20170327122455/http://help.adobe.com/livedocs/specs/actionscript/3/wwhelp/wwhimpl/js/html/wwhelp.htm |archive-date=March 27, 2017 |url-status=dead |df=mdy-all }}</ref> and both an open-source compiler (as part of [[Apache Flex]]) and open-source virtual machine ([[Tamarin (software)|Tamarin]]) are available.
 
ActionScript was also used with [[Scaleform GFx]] for the development of three-dimensional video-game user interfaces and [[heads up display]]s.
Line 125 ⟶ 126:
</syntaxhighlight>
 
Minimal ActionScript 3.0 programs may be somewhat larger and more complicated due to the increased separation of the programming language and the Flash [[integrated development environment|IDE]] (IDE).
 
Presume the following file to be {{Mono|Greeter.as}}:
Line 140 ⟶ 141:
var txtHello: TextField = new TextField();
txtHello.text = "Hello World";
addParentthis.addChild(txtHello);
}
}
Line 200 ⟶ 201:
* '''EventListener'''
 
'''ActionScript 3 primitive (prime) data types'''<ref name="adobe1">{{cite web |url=http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000047.html |title=Data type descriptions + Flash CS3 Documentation |access-date=2007-07-13 |archive-url=https://web.archive.org/web/20071102191956/http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000047.html |archive-date=November 2, 2007 |df=mdy-all }}</ref>
 
* '''Boolean''': The [[Boolean data type]] has only two possible values: true and false or 1 and 0. No other values are valid.
Line 259 ⟶ 260:
// and the third (2) is an object with { a: 5, b: 7 }.
</syntaxhighlight>
Unlike some object-oriented languages, ActionScript makes no distinction between [[Primitive data type|primitive]] types and [[reference (computer science)|reference]] types. In ActionScript, all variables are reference types. However, objects that belong to the primitive data types, which includes Boolean, Number, int, uint, and String, are immutable.<ref>{{cite web |url=http://livedocs.adobe.com/flex/3/html/03_Language_and_Syntax_19.html |title=Flex 3 – Function parameters |publisher=Livedocs.adobe.com |access-date=December 17, 2009 |archive-url=https://web.archive.org/web/20090212103954/http://livedocs.adobe.com/flex/3/html/03_Language_and_Syntax_19.html |archive-date=February 12, 2009 |url-status=dead |df=mdy-all }}</ref>
 
So if a variable of a supposedly primitive type, e.g. an integer is passed to a function, altering that variable inside the function will not alter the original variable, as a new int Object is created when inside the function. If a variable of another (not primitive) datatype, e.g. XML is passed to a function, altering that variable inside the function will alter the original variable as well, as no new XML Object is created.
Line 290 ⟶ 291:
 
==Code protection==
Like most [[bytecode]] file formats, Flash [[SWF]] files can be [[decompilation|decompiled]] into their source code and assets (similarly to how [[.NET Framework|Microsoft .NET]] files can be decompiled). Some decompilers are capable of nearly full reconstruction of the original source file, downapproximate to the actual code that was used during creation (although results vary on a case-by-case basis).<ref>{{cite web |url=http://www.flashmagazine.com/reviews/detail/review_trillix_flash_decompiler_3/ |title=Third party review of another decompiler |publisher=Flashmagazine.com |date=October 21, 2007 |access-date=April 22, 2013 |archive-url=https://web.archive.org/web/20170620134350/http://www.flashmagazine.com/reviews/detail/review_trillix_flash_decompiler_3/ |archive-date=June 20, 2017 |url-status=dead }}</ref><ref>{{cite web |url=http://www.topshareware.com/reviews/10386-1/flash-decompiler.htm |title=Customer comments on one Flash decompiler |publisher=Topshareware.com |access-date=April 22, 2013 |archive-date=November 8, 2016 |archive-url=https://web.archive.org/web/20161108235827/http://www.topshareware.com/reviews/10386-1/flash-decompiler.htm |url-status=dead }}</ref><ref>[http://www.macupdate.com/reviews.php?id=11541 Customer comments on another Flash product] {{webarchive |url=https://web.archive.org/web/20060818085731/http://www.macupdate.com/reviews.php?id=11541 |date=August 18, 2006 }}</ref>
 
In opposition to the decompilers, ActionScript [[obfuscated code|obfuscators]] have been introduced, which transform code into a form that breaks decompiler output while preserving the functionality and structure of the program. Higher-quality obfuscators implement lexical transformations such as identifier renaming, control flow transformation, and data abstraction transformation which collectively make it harder for decompilers to generate output likely to be useful to a human. Less robust obfuscators insert traps for decompilers. Such obfuscators either cause the decompiler software to crash unexpectedly or to generate unintelligible source code.{{Citation needed|date=March 2021}}
 
==References==
{{Reflist|30em}}
 
==External links==
Line 301 ⟶ 302:
{{Wikibooks|Introduction to ActionScript 2.0}}
{{Wikiversity|ActionScript:Introduction}}
* [https://{{Official website|www.adobe.com/devnet/actionscript/}}, ActionScript Technology Center]
* [http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html ActionScript 2.0 Language Reference] {{Webarchive|url=https://web.archive.org/web/20130131044759/http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html |date=January 31, 2013 }}
* [http://help.adobe.com/en_US/AS3LCR/Flash_10.0/ ActionScript 3.0 Language & Component Reference]
** [http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/language-elements.html Language Elements]
Line 311 ⟶ 312:
* [https://web.archive.org/web/20100304105648/http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3/ Adobe Flex SDK]
* {{cite web |url=https://www.theverge.com/2017/7/25/16026236/adobe-flash-end-of-support-2020 |title=Adobe will finally kill Flash in 2020 |last=Warren |first=Tom |date=July 25, 2017 |website=The Verge |access-date=December 16, 2020 |archive-url=https://web.archive.org/web/20170725190530/https://www.theverge.com/2017/7/25/16026236/adobe-flash-end-of-support-2020 |archive-date=July 25, 2017 |url-status=live}}
 
{{Adobe Flash|state=uncollapsed}}
{{ECMAScript}}
Line 325 ⟶ 327:
[[Category:High-level programming languages]]
[[Category:Programming languages compiled to bytecode]]
<!-- Hidden categories below -->
[[Category:Articles with example JavaScript code]]
[[Category:Statically typed programming languages]]