ActionScript ▪ Sale
ActionScript
ActionScript icon.png
Appeared in 1998
Designed by Gary Grossman
Developer Macromedia (now Adobe Systems)
Stable release 3.0 (June 27, 2006 (2006-06-27))
Typing discipline strong, static
Major implementations Adobe Flash, Apache Flex
Influenced by JavaScript, Java
OS Cross-platform
ActionScript
Filename extension .as
Internet media type application/ecmascript

ActionScript is an object-oriented language originally developed by Macromedia Inc. (now owned by Adobe Systems). It is a dialect of ECMAScript (meaning it is a superset of the syntax and semantics of the language more widely known as JavaScript), and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of embedded SWF files. The language itself is open-source in that its specification is offered free of charge and both an open source compiler (as part of Apache Flex) and open source virtual machine (Mozilla Tamarin) are available.

ActionScript was initially designed for controlling simple 2D vector animations made in Adobe Flash (formerly Macromedia Flash). Initially focused on animation, early versions of Flash content offered few interactivity features and thus had very limited scripting capability. Later versions added functionality allowing for the creation of Web-based games and rich Internet applications with streaming media (such as video and audio). Today, ActionScript is suitable for use in some database applications, and in basic robotics, as with the Make Controller Kit.

Flash MX 2004 introduced ActionScript 2.0, a scripting language more suited to the development of Flash applications. It is often possible to save time by scripting something rather than animating it, which usually also enables a higher level of flexibility when editing.

Since the arrival of the Flash Player 9 alpha (in 2006) a newer version of ActionScript has been released, ActionScript 3.0. ActionScript 3.0 is an object-oriented programming language allowing far more control and code reusability when building complex Flash applications. This version of the language is intended to be compiled and run on a version of the ActionScript Virtual Machine that has been itself completely re-written from the ground up (dubbed AVM2). Because of this, code written in ActionScript 3.0 is generally targeted for Flash Player 9 and higher and will not work in previous versions. At the same time, ActionScript 3.0 executes up to 10 times faster than legacy ActionScript code due to the Just-In-Time compiler enhancements.

Flash libraries can be used with the XML capabilities of the browser to render rich content in the browser. This technology is known as Asynchronous Flash and XML, much like AJAX. Adobe offers its Flex product line to meet the demand for Rich Internet Applications built on the Flash runtime, with behaviors and programming done in ActionScript. ActionScript 3.0 forms the foundation of the Flex 2 API.

History [edit]

Action Script started as an object-oriented language for Macromedia's Flash authoring tool, now developed by Adobe Systems as Adobe Flash. The first three versions 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 Flash 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 the term "actions" to describe this set of commands.

Timeline by player version [edit]

Timeline by ActionScript version [edit]

2000–2004: 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. This was the first version of ActionScript with influences from JavaScript and the ECMA-262 (Third Edition) standard, supporting the said standard's 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, 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; there 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-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, ActionScript 1.0 uses a special object that serves as a "prototype" for a class of objects. All common characteristics of a class are defined in the class's prototype object and every instance of that class contains a link to that prototype object.

2003–2006: ActionScript 2.0 The next major revision of the language, ActionScript 2.0, was introduced in September 2003 with the release of Flash MX 2004 and its corresponding player, Flash Player 7. In response to user demand for a language better equipped for larger and more complex applications, ActionScript 2.0 featured compile-time type checking and class-based syntax, such as the keywords class and extends. (While this allowed for a more structured object-oriented programming approach, the code would still be compiled to ActionScript 1.0 bytecode, allowing it to be used on the preceding Flash Player 6 as well. In other words, the class-based inheritance syntax was a layer on top of the existing prototype-based system.) With ActionScript 2.0, developers could constrain variables to a specific type by adding a type annotation so that type mismatch errors could be found at compile-time. ActionScript 2.0 also introduced class-based inheritance syntax so that developers could create classes and interfaces, much as they would in class-based languages such as Java and C++. This version conformed partially to the ECMAScript Fourth Edition draft specification.

2006–today: ActionScript 3.0 In June 2006, ActionScript 3.0 debuted with Adobe Flex 2.0 and its corresponding player, Flash Player 9. ActionScript 3.0 was a fundamental restructuring of the language, so much so that it uses an entirely different virtual machine. Flash Player 9 contains two virtual machines, AVM1 for code written in ActionScript 1.0 and 2.0, and AVM2 for content written in ActionScript 3.0. Actionscript 3.0 added limited support for hardware acceleration (DirectX, OpenGL).

The update to the language introduced several new features:

Flash Lite [edit]

AIR [edit]

Adobe AIR supports ActionScript, in addition to some extended contents, such as the Stage3D engine Adobe has developed. ActionScript on Adobe AIR has also increased efficiency and popularity because of its versatility of being able to run on many interfaces. The amount of APIs (Application programming interfaces) pointed at ActionScript 3.0 has also risen dramatically.

Syntax [edit]

ActionScript code is free form and thus may be created with whichever amount or style of whitespace that the author desires. The basic syntax is derived from ECMAScript.

ActionScript 2.0 [edit]

The following code, which works in any compliant player, creates a text field at depth 0, at position (0, 0) on the screen (measured in pixels), that is 100 pixels wide and high. Then the text parameter is set to the "Hello, world" string, and it is automatically displayed in the player:

createTextField("greet", 0, 0, 0, 100, 100);
greet.text = "Hello, world";

When writing external ActionScript 2.0 class files the above example could be written in a file named Greeter.as as following.

class com.example.Greeter extends MovieClip
{
    public function Greeter()
    {
        var txtHello:TextField = this.createTextField("txtHello", 0, 0, 0, 100, 100);
        txtHello.text = "Hello, world";
    }
}

ActionScript 3.0 [edit]

ActionScript 3.0 has a similar syntax to ActionScript 2.0 but a different set of APIs for creating objects. Compare the script below to the previous ActionScript 2.0 version:

var greet:TextField = new TextField();
greet.text = "Hello World";
this.addChild(greet);

Minimal ActionScript 3.0 programs may be somewhat larger and more complicated due to the increased separation of the programming language and the Flash IDE.

Presume the following file to be Greeter.as:

package com.example
{
    import flash.text.TextField;
    import flash.display.Sprite;
 
    public class Greeter extends Sprite
    {
        public function Greeter()
        {
            var txtHello:TextField = new TextField();
            txtHello.text = "Hello World";
            addChild(txtHello);
        }
    }
}

(See also: Sprite)

Actionscript 3 can also be used in MXML files when using Apache's Flex framework:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/mx/polysylabi"
               xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical"
               creationComplete="initApp()">
 
    <fx:Script>
        <![CDATA[
            public function initApp():void
            {
                // Prints our "Hello, world!" message into title
               title.text="Hello, World!";
            }
        ]]>
    </fx:Script>
 
    <s:Label id="title" fontSize="54" fontStyle="bold"/>
</s:Application>

Data structures [edit]

Data types [edit]

ActionScript primarily consists of "fundamental" or "simple" data types which are used to create other data types. These data types are very similar to Java data types. Since ActionScript 3 was a complete rewrite of ActionScript 2, the data types and their inheritances have changed.

ActionScript 2 top level data types

ActionScript 2 complex data types

There are additional "complex" data types. These are more processor and memory intensive and consist of many "simple" data types. For AS2, some of these data types are:

ActionScript 3 primitive (prime) data types

ActionScript 3 some complex data types

Using data types [edit]

The basic syntax is:

var yourVariableName:YourVariableType = new YourVariableType(Param1, Param2, ..., ParamN);

So in order to make an empty Object:

var myObject:Object = new Object();

Or, in an informal way:

var myObject = {};

Some types are automatically put in place:

var myString:String = "Hello Wikipedia!"; // This would automatically set the variable as a string.
var myNumber:Number = 5; // This would do the same for a number.
var myObject:Object = {Param1:"Hi!", Param2:76}; //This creates an object with two variables.
// Param1 is a string with the data of "Hi!",
// and Param2 is a number with the data of 76.
var myArray:Array = [5,"Hello!",{a:5, b:7}]; //This is the syntax for automatically creating an Array.
//It creates an Array with 3 variables.
//The first (0) is a number with the value of 5,
//the second (1) is a string with the value of "Hello!",
//and the third (2) is an object with {a:5, b:7}.

Unlike some object-oriented languages, ActionScript makes no distinction between primitive types and 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.

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.

Some data types can be assigned values with literals:

var item1:String="ABC";
var item2:Boolean=true;
var item3:Number=12;
var item4:Array=["a","b","c"];
var item5:Object={name:"Actionscript",version:"3.0"};
var item6:XML = <node><child/></node>; //Note that the primitive XML is not quoted

A reference in ActionScript is a pointer to an instance of a class. A reference stores the memory address of an object - operations against references will follow the value of the reference to the memory address of the object & carry out the operation on that object. All objects in ActionScript are accessed through references instead of being accessed directly.

var item1:XML=new XML("<node><child/></node>");
var item2:XML=item1;
item2.firstChild.attributes.value=13;
//item1 now equals item2 since item2 simply points to what item1 points to.
//Both are now:
//<node><child value="13"/></node>

Only references to an object may be removed by using the "delete" keyword. Removal of actual objects and data is done by the Flash Player garbage collector which checks for any existing references in the Flash memory space. If none are found (no other reference is made to the orphaned object), it is removed from memory. For this reason, memory management in ActionScript requires careful application development planning.

var item1:XML=new XML("<node><child/></node>");
delete item1;
//If no other reference to item1 is present anywhere else in the application,
//it will be removed on the garbage collector's next pass

Code protection [edit]

As with all intermediate language compiled code such as Flash and Microsoft .NET, once an SWF file is saved locally, it can be decompiled into its source code and assets. Some decompilers are capable of nearly full reconstruction of the original source file, down to the actual code that was used during creation (although results vary on a case-by-case basis).

In opposition to the decompilers, ActionScript obfuscators have been introduced to solve this problem, 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.

The following is an example of ActionScript 3.0 code generated by a decompiler program, before and after obfuscation.

Code before obfuscation:

private function getNeighbours(i:int, j:int):Array{
  var a:Array = new Array();
  for (var k = 0; k < 8; k++){
    var ni = i + int(neighbour_map[k][0]);
    var nj = j + int(neighbour_map[k][1]) ;
    if (ni < 0 || ni >= xsize || nj < 0 || nj >= ysize)
      continue;
    a.push(Cell(cells[ni][nj]));
  }
  return a;
}

Code after obfuscation:

private function getNeighbours(_arg1:int, _arg2:int):Array{
  var _local3:Array = -(((null - !NULL!) % ~(undefined)));
  var _local4:*;
  var _local5:*;
  var _local6:*;
  _local3 = new Array();
  _local4 = 0;
  for (;//unresolved jump
  , _arg2 < 8;_local4++) {
    _local5 = (_arg1 + int(!NULL!));
    _local6 = (_arg2 + int(!NULL!));
    if (true){
      _arg1 = (((//unresolved nextvalue or nextname << !NULL!) + !NULL!) 
<< undefined);
      _arg1 = (!(!NULL!) ^ !NULL!);
      (!NULL! instanceof !NULL!);
      var _local1 = (((!NULL! as !NULL!) + !NULL!) == this);
      if (!(!NULL! == !NULL!)){
        -((true << !NULL!)).push(Cell(cells[_local5][_local6]));
      }
    }
    if (!true){
      (_local6 < 0);
      (_local6 < 0);
      (_local5 < 0);
    }
  }
return (_local3);
}

References [edit]

  1. RFC 4329 (limit compatible with EcmaScript)
  2. http://livedocs.adobe.com/specs/actionscript/3/wwhelp/wwhimpl/js/html/wwhelp.htm
  3. Brimelow, Lee (August 18, 2008). "Six reasons to use ActionScript 3.0". Adobe Systems Incorporated. Retrieved June 18, 2010. 
  4. Grossman, Gary; Huang, Emmy (June 27, 2006). "ActionScript 3.0 overview". Adobe Systems Incorporated. Retrieved June 18, 2010. 
  5. "Standard ECMA-262". Ecma-international.org. Retrieved April 22, 2013. 
  6. "ECMAScript". ECMAScript. Retrieved April 22, 2013. 
  7. "Flash Player | Adobe Flash Player 11 | Overview". Adobe.com. April 9, 2013. Retrieved April 22, 2013. 
  8. "Adobe Labs - Adobe Flash Player 10.1". Labs.adobe.com. Archived from the original on January 5, 2010. Retrieved December 17, 2009. 
  9. "Flash Player 11 and AIR 3 Release Notes for Adobe Labs". 
  10. Note that the name "ActionScript 1.0" is a retronym, coined after the release of ActionScript 2.0.
  11. http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000047.html
  12. "Flex 3 - Function parameters". Livedocs.adobe.com. Retrieved December 17, 2009. 
  13. "Third party review of another decompiler". Flashmagazine.com. October 21, 2007. Retrieved April 22, 2013. 
  14. "Customer comments on one Flash decompiler". Topshareware.com. Retrieved April 22, 2013. 
  15. Customer comments on another Flash product[dead link]

External links [edit]

Popular search requests

ActionScript is an object of interest for many people. For example, the people often search for ActionScript website, ActionScript blog, ActionScript online, ActionScript information, ActionScript photo, ActionScript picture, ActionScript video, ActionScript movie, ActionScript history, ActionScript news, ActionScript facts, ActionScript description, ActionScript detailed info, ActionScript features, ActionScript manual, ActionScript instructions, ActionScript comparison, ActionScript book, ActionScript story, ActionScript article, ActionScript review, ActionScript feedbacks, ActionScript selection, ActionScript data, ActionScript address, ActionScript phone number, download ActionScript, ActionScript reference, ActionScript wikipedia, ActionScript facebook, ActionScript twitter, ActionScript 2013, ActionScript 2014, ActionScript in the United States, ActionScript USA, ActionScript US, ActionScript in United Kingdom, ActionScript UK, ActionScript in Canada, ActionScript in Australia, etc.

ActionScript is also an object of commercial interest. For example, many people are interested in ActionScript offers, ActionScript buy, ActionScript sell, ActionScript sale, ActionScript discounts, discounted ActionScript, ActionScript coupon, ActionScript promo code, ActionScript order, to order ActionScript online, to buy ActionScript, how much for ActionScript, ActionScript price, ActionScript cost, ActionScript price list, ActionScript tariffs, ActionScript rates, ActionScript prices, ActionScript delivery, ActionScript store, ActionScript online store, ActionScript online shop, inexpensive ActionScript, cheap ActionScript, ActionScript for free, free ActionScript, used ActionScript, and so on.

Information source: wikipedia.org

Do you want to know more? Look at the full version of the ActionScript article.

HOT DESIGNS
Premium designs
Designs by country
Designs by U.S. state
Most popular designs
Newest, last added designs
Unique designs
Cheap, budget designs
Design super sale

DESIGNS BY THEME
Accounting, audit designs
Adult, sex designs
African designs
American, U.S. designs
Animals, birds, pets designs
Agricultural, farming designs
Architecture, building designs
Army, navy, military designs
Audio & video designs
Automobiles, car designs
Books, e-book designs
Beauty salon, SPA designs
Black, dark designs
Business, corporate designs
Charity, donation designs
Cinema, movie, film designs
Computer, hardware designs
Celebrity, star fan designs
Children, family designs
Christmas, New Year's designs
Green, St. Patrick designs
Dating, matchmaking designs
Design studio, creative designs
Educational, student designs
Electronics designs
Entertainment, fun designs
Fashion, wear designs
Finance, financial designs
Fishing & hunting designs
Flowers, floral shop designs
Food, nutrition designs
Football, soccer designs
Gambling, casino designs
Games, gaming designs
Gifts, gift designs
Halloween, carnival designs
Hotel, resort designs
Industry, industrial designs
Insurance, insurer designs
Interior, furniture designs
International designs
Internet technology designs
Jewelry, jewellery designs
Job & employment designs
Landscaping, garden designs
Law, juridical, legal designs
Love, romantic designs
Marketing designs
Media, radio, TV designs
Medicine, health care designs
Mortgage, loan designs
Music, musical designs
Night club, dancing designs
Photography, photo designs
Personal, individual designs
Politics, political designs
Real estate, realty designs
Religious, church designs
Restaurant, cafe designs
Retirement, pension designs
Science, scientific designs
Sea, ocean, river designs
Security, protection designs
Social, cultural designs
Spirit, meditational designs
Software designs
Sports, sporting designs
Telecommunication designs
Travel, vacation designs
Transport, logistic designs
Web hosting designs
Wedding, marriage designs
White, light designs

E-COMMERCE DESIGNS
Magento store designs
OpenCart store designs
PrestaShop store designs
CRE Loaded store designs
Jigoshop store designs
VirtueMart store designs
osCommerce store designs
Zen Cart store designs

CMS DESIGNS
Flash CMS designs
Joomla CMS designs
Mambo CMS designs
Drupal CMS designs
WordPress blog designs
Forum designs
phpBB forum designs
PHP-Nuke portal designs

ANIMATED WEBSITE DESIGNS
Flash CMS designs
Silverlight animated designs
Silverlight intro designs
Flash animated designs
Flash intro designs
XML Flash designs
Flash 8 animated designs
Dynamic Flash designs
Flash animated photo albums
Dynamic Swish designs
Swish animated designs
jQuery animated designs

WEBSITE DESIGNS
WebMatrix Razor designs
HTML 5 designs
Web 2.0 designs
3-color variation designs
3D, three-dimensional designs
Artwork, illustrated designs
Clean, simple designs
CSS based website designs
Full design packages
Full ready websites
Portal designs
Stretched, full screen designs
Universal, neutral designs

CORPORATE ID DESIGNS
Corporate identity sets
Logo layouts, logo designs
Logotype sets, logo packs
PowerPoint, PTT designs
Facebook themes

VIDEO, SOUND & MUSIC
Video e-cards
After Effects video intros
Special video effects
Music tracks, music loops
Stock music bank

GRAPHICS & CLIPART
Pro clipart & illustrations, $19/year
5,000+ icons by subscription
Icons, pictograms

 
ActionScript Sale - Buy now!
Super Offers
Super Offers
Custom Logo Design $149  ▪  Web Programming  ▪  ID Card Printing  ▪  Best Web Hosting  ▪  eCommerce Software  ▪  Add Your Link
© 1996-2013 MAGIA Internet StudioAboutPortfolioPhoto on DemandHostingAdvertiseSitemapPrivacyMaria Online