FACTOID # 65: Per capita, South Africa has the most assaults, rapes, and murders with firearms.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "Actionscript" also viewed:
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Actionscript
ActionScript
Paradigm Multi-paradigm
Appeared in 1998
Designed by Gary Grossman
Developer Macromedia, Adobe Systems
Latest release 3.0/ June 27, 2006
Typing discipline Strongly, Statically, Safely typed
Major implementations Adobe Flash, Adobe Flex
Influenced by JavaScript, Java
OS Cross-platform
ActionScript
File extension: .as
MIME type: application/actionscript[1]

ActionScript is a scripting language based on ECMAScript, 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). Originally developed by Macromedia, the language is now owned by Adobe (which acquired Macromedia in 2005) and continues its development. ActionScript was initially designed for controlling simple 2D vector animations made in Adobe Flash (formerly Macromedia Flash). Later versions added functionality allowing for the creation of Web-based games and rich Internet applications with streaming media (such as video and audio). Image File history File links Gnome_globe_current_event. ... A programming paradigm is a paradigmatic style of programming (compare with a methodology, which is a paradigmatic style of doing software engineering). ... This does not cite any references or sources. ... For other uses, see Software developer (disambiguation). ... Macromedia was an American graphics and web development software house headquartered in San Francisco, California producing such products as Macromedia Flash. ... Adobe Systems (pronounced a-DOE-bee IPA: ) (NASDAQ: ADBE) (LSE: ABS) is an American computer software company headquartered in San Jose, California, USA. Adobe was founded in December 1982[1] by John Warnock and Charles Geschke, who established the company after leaving Xerox PARC in order to develop and sell... A software release refers to the creation and availability of a new version of a computer software product. ... In computer science, a type system defines how a programming language classifies values and expressions into types, how it can manipulate those types and how they interact. ... In computer science and computer programming, the term strong typing is used to describe those situations where programming languages specify one or more restrictions on how operations involving values having different datatypes can be intermixed. ... On computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ... In computer science, a programming language is type safe when the language does not permit the programmer to treat a value as a type to which it does not belong. ... Look up Implementation in Wiktionary, the free dictionary. ... Adobe Flash, or simply Flash, refers to both the Adobe Flash Player, and to the Adobe Flash Professional multimedia authoring program. ... Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross platform, rich Internet applications based on the proprietary Adobe Flash platform. ... JavaScript is a scripting language most often used for client-side web development. ... “Java language” redirects here. ... An operating system (OS) is the software that manages the sharing of the resources of a computer and provides programmers with an interface used to access those resources. ... A cross-platform (or platform independent) programming language, software application or hardware device works on more than one system platform (e. ... A filename extension is a suffix to the name of a computer file applied to show its format. ... For mime as an art form, see mime artist. ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ... Macromedia was an American graphics and web development software house headquartered in San Francisco, California producing such products as Macromedia Flash. ... Adobe Systems (pronounced a-DOE-bee IPA: ) (NASDAQ: ADBE) (LSE: ABS) is an American computer software company headquartered in San Jose, California, USA. Adobe was founded in December 1982[1] by John Warnock and Charles Geschke, who established the company after leaving Xerox PARC in order to develop and sell... Adobe Flash, or simply Flash, refers to both the Adobe Flash Player, and to the Adobe Flash Professional multimedia authoring program. ... // == Macromedia Flash == ==]] Using Macromedia Flash 8 (bundled in Studio 8) in Windows XP. Maintainer: Adobe Systems (formerly Macromedia) Latest release: 8 / September 30th, 2005 OS: Windows (no native Windows XP Professional x64 Edition support), Mac OS X, Linux (i386 only, via wine [1]) Use: Multimedia Content Creator License: Proprietary Website... For the geographical term, see ria. ...

Contents

History

ActionScript started as a scripting language for the Macromedia Flash authoring tool. 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 limited to basic navigation controls, with commands such as "play", "stop", "get URL", and "goto and play". Scripting languages (commonly called script languages) are computer programming languages that are typically interpreted. ... // == Macromedia Flash == ==]] Using Macromedia Flash 8 (bundled in Studio 8) in Windows XP. Maintainer: Adobe Systems (formerly Macromedia) Latest release: 8 / September 30th, 2005 OS: Windows (no native Windows XP Professional x64 Edition support), Mac OS X, Linux (i386 only, via wine [1]) Use: Multimedia Content Creator License: Proprietary Website...


With the release of Flash 4 in 1999, this simple set of actions matured into 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. Scripting languages (commonly called script languages) are computer programming languages that are typically interpreted. ... In computer science and mathematics, a variable (pronounced ) (sometimes called an object or identifier in computer science) is a symbolic representation used to denote a quantity or expression. ... An expression in a programming language is a combination of values and functions or procedures, interpreted according to the particular rules of precedence and of association for a particular programming language, which computes and then returns another value. ... Programming languages generally have a set of operators that are similar to operators in mathematics: they are somehow special functions. ... “Then” redirects here. ... In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions or function calls of an imperative or functional program are executed or evaluated. ...


Time line by player

  • Flash Lite 1.0 and 1.1: Flash Lite is the Flash technology specifically developed for mobile phones and consumer electronics devices. Flash Lite 1.1 supports Flash 4 ActionScript.
  • Flash Lite 2.1: Added support for Flash 7 ActionScript 2.0.
  • Flash Player 2: 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 player with a full scripting implementation (called Actions). The scripting was a slash based syntax and contained support for loops, conditionals, variables and other basic language constructs.
  • Flash Player 6: Added an event handling model, and support for switch. First version with support for the AMF and RTMP protocols which allowed to stream live and ondemand audio/video.
  • Flash Player 7: Flash Player 7 offered some new features such as CSS text and performance improvements. Macromedia Flash compilers released alongside Flash Player 7 also support ActionScript 2.0, a Class programming language based on the ECMAScript 4 Netscape Proposal. However, ActionScript 2.0 can cross compile to ActionScript 1.0 byte-code, so it can be run by Flash Player 6.
  • Flash Player 8: Further extended ActionScript 2.0 by adding new class libraries with APIs for controlling bitmap data at run-time, and file-upload.
  • Flash Player 9 (initially called 8.5): Added ActionScript 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 compilation. This is the first release of the player to be titled Adobe Flash Player.

This article is about the proprietary file format . ... Prototype-based programming is a style of object-oriented programming in which classes are not present, and behaviour reuse (known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. ... This does not adequately cite its references or sources. ... Object-oriented programming (OOP) is a programming paradigm that uses objects and their interactions to design applications and computer programs. ... AMF is a binary format based loosely on the Simple Object Access Protocol (SOAP). ... Real Time Messaging Protocol (RTMP) is a proprietary protocol developed by Adobe Systems (formerly developed by Macromedia) that is primarily used with Macromedia Flash Media Server to stream audio and video over the internet to the Adobe Flash Player client. ... In object-oriented programming, a class is a programming language construct used to group related fields and methods. ... Compiling a program takes place by running the compiler on the build platform. ... Byte-code is a sort of intermediate code that is more abstract than machine code. ... See also Just in time for the business technique In computing, just-in-time compilation (JIT), also known as dynamic translation, is a technique for improving the performance of interpreted programs. ...

Time line by ActionScript version

2000–2003: 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.[2] 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. JavaScript is a scripting language most often used for client-side web development. ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... In programming languages a data type defines a set of values and the allowable operations on those values[1]. For example, in the Java programming language, the int type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, and... In computer science and mathematics, a variable (pronounced ) (sometimes called an object or identifier in computer science) is a symbolic representation used to denote a quantity or expression. ... In general, a function is part of an answer to a question about why some object or process occurred in a system that evolved or was designed with some goal. ... In computer programming, a parameter is a variable which takes on the meaning of a corresponding argument passed in a call to a subroutine. ... In computer programming, subprograms (functions) will return to the higher-level programs, which called them; return ends the current task. ... The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... Prototype-based programming is a style of object-oriented programming in which classes are not present, and inheritance is accomplished by cloning existing objects which serve as prototypes for the new ones. ... This article or section does not cite any references or sources. ... In computer science and mathematics, a variable (pronounced ) (sometimes called an object or identifier in computer science) is a symbolic representation used to denote a quantity or expression. ... Object-oriented programming (OOP) is a programming paradigm that uses objects and their interactions to design applications and computer programs. ... In object-oriented programming, a class is a programming language construct used to group related fields and methods. ... In object-oriented programming, a class is a programming language construct used to group related fields and methods. ... In object-oriented programming, a class is a programming language construct used to group related fields and methods. ... In object-oriented programming, a class is a programming language construct used to group related fields and methods. ... Instantiation is the process of creating a specific object (computing) which is a member or instance of a class (computing). ... In object-oriented programming, a class is a programming language construct used to group related fields and methods. ...


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 flexible 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. The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ... In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ... On computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ... The syntax of a programming language is the set of rules that a sequence of characters in a source code file must follow to be considered a conforming program in that language. ... Bytecode is a binary representation of an executable program designed to be executed by a virtual machine rather than by dedicated hardware. ... Class-based programming, or more commonly class-orientation, refers to the style of object-oriented programming in which inheritance is achieved by defining classes of objects, as opposed to the objects themselves (compare Prototype-based programming). ... The syntax of a programming language is the set of rules that a sequence of characters in a source code file must follow to be considered a conforming program in that language. ... Prototype-based programming is a style of object-oriented programming in which classes are not present, and behaviour reuse (known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. ... In computer science and mathematics, a variable is a symbol denoting a quantity or symbolic representation. ... In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ... The syntax of a programming language is the set of rules that a sequence of characters in a source code file must follow to be considered a conforming program in that language. ... “Java language” redirects here. ... C++ (pronounced see plus plus, IPA: ) is a general-purpose programming language with high-level and low-level capabilities. ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 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 provides not only a significant enhancement in performance, but also a more robust programming model that lends itself to complex Rich Internet Application development. Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross platform, rich Internet applications based on the proprietary Adobe Flash platform. ... The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ... In computer science, a virtual machine is software that creates a virtualized environment between the computer platform and its operating system, so that the end user can operate software on an abstract machine. ... The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ... In general terms, a virtual machine in computer science is software that creates an environment between the computer platform and the end user in which the end user can operate software. ... For the geographical term, see ria. ...


The update to the language introduced several new features:

In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ... In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... On computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ... A Java package is a Java programming language mechanism for organizing classes into namespaces. ... A namespace is a context in which a group of one or more identifiers might exist. ... A regular expression (abbreviated as regexp, regex or regxp) is a string that describes or matches a set of strings, according to certain syntax rules. ... Bytecode is a binary representation of an executable program designed to be executed by a virtual machine rather than by dedicated hardware. ... Bytecode is a binary representation of an executable program designed to be executed by a virtual machine rather than by dedicated hardware. ... API may refer to: In computing, application programming interface In petroleum industry, American Petroleum Institute In education, Academic Performance Index This page concerning a three-letter acronym or abbreviation is a disambiguation page — a navigational aid which lists other pages that might otherwise share the same title. ... A Java package is a Java programming language mechanism for organizing classes into namespaces. ... An event handler is a part of a computer program created to tell the program how to act in response to a specific event (e. ... DOM Events allow event-driven programming languages like JavaScript, JScript, ECMAScript, VBScript and Java to register various event handlers/listeners on the element nodes inside a DOM tree, e. ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... ECMAScript for XML (E4X) is a programming language extension that adds native XML support to ECMAScript (which include ActionScript, DMDScript, JavaScript, JScript). ... The Extensible Markup Language (XML) is a general-purpose markup language. ... In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ...

Syntax

ActionScript code is free form and thus may be created with whichever amount or style of whitespace that the author desires. In computer programming, a free-form language is a programming language in which the positioning of characters on the page in program text is not significant. ...


ActionScript 2.0

When one is working with the Macromedia Flash IDE, it is possible to use the trace() function to print information in the application's output terminal. If one uses this command, then a very short "legal" program in ActionScript would be the following code on frame 1 of layer 1 in an otherwise empty Flash document: // == Macromedia Flash == ==]] Using Macromedia Flash 8 (bundled in Studio 8) in Windows XP. Maintainer: Adobe Systems (formerly Macromedia) Latest release: 8 / September 30th, 2005 OS: Windows (no native Windows XP Professional x64 Edition support), Mac OS X, Linux (i386 only, via wine [1]) Use: Multimedia Content Creator License: Proprietary Website... An integrated development environment (IDE), also known as integrated design environment and integrated debugging environment, is a programming environment that has been packaged as an application program,that assists computer programmers in developing software. ...

 trace("Hello, world!"); 

However, due to this command being unused in other interpreters of the language, such as the standard Adobe Flash Player, it is reasonable to suggest that this does not suffice. For such a reason, one can consider the following code instead, which works in any compliant player, as the shortest program instead:[3] The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ...

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

This creates a text field at depth 0, at location 0, 0 px on the screen, that is 100 px wide and high. Then the "text" parameter is set to the "Hello, world!" string, and it is automatically displayed in the player.


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

Minimal ActionScript 3.0 programs are somewhat larger and more complicated due to the inherently different structure of an application, and 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); } } } 

Finally, an example of using ActionScript when developing Flex applications, again presuming the following content to be in a file named Greeter.as: Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross platform, rich Internet applications based on the proprietary Adobe Flash platform. ...

 package { public class Greeter { public static function sayHello():String { var greet:String = "Hello, world!"; return greet; } } } 

This code will work with the following MXML application file: MXML is an XML-based user interface markup language first introduced by the former Macromedia in March 2004. ...

 <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="vertical" creationComplete="initApp()"> <mx:Script> <![CDATA[[  public function initApp():void  {  // Prints our "Hello, world!" message into "mainTxt".  mainTxt.text = Greeter.sayHello();  }  ]]> </mx:Script> <mx:Label id="title" fontSize="24" fontStyle="bold" text=""Hello, world!" Example"/> <mx:TextArea id = "mainTxt" width="250"/> </mx:Application> 

Examples

ActionScript 2.0 examples

The following prints Hello world into the Flash IDE output panel. Note this will only work when run inside the Flash IDE, as the trace function is only supported inside it. A hello world program is a computer program that prints out Hello, world! on a display device. ... An integrated development environment (IDE), also known as integrated design environment and integrated debugging environment, is a programming environment that has been packaged as an application program,that assists computer programmers in developing software. ... An integrated development environment (IDE), also known as integrated design environment and integrated debugging environment, is a programming environment that has been packaged as an application program,that assists computer programmers in developing software. ...

 trace("Hello world!"); 

The following code prints Hello world to the stage. A hello world program is a computer program that prints out Hello, world! on a display device. ...

 _root.createTextField("myText", 1, 0, 0, 100, 25); _root.myText.text = "Hello world!"; 

The following code outputs the current mouse position when the mouse moves, by using the onMouseMove event. Again this will only work in the Flash IDE.

 onMouseMove = function () { trace("X: " + _root._xmouse); trace("Y: " + _root._ymouse); }; 

The following code, when placed on a Button, begins to play the timeline of the MovieClip the button is placed in. This also applies to the root timeline since the root is considered a MovieClip as well. In computing, a button (sometimes known as a command button or push button) is a widget that provides the user a simple way to trigger an event, like searching for a query at a search engine, or to interact with dialog boxes, like confirming his actions. ...

 on(release) { play(); } 

This more advanced example creates an array containing numbers and strings, and assigns a number to a variable called num and a string to a variable called str using prototype functions and function recursion. Then, using the MovieClip API, a text field is drawn on screen, into which the variable values are written.

 Array.prototype.pickNumber = function():Number { var rand:Number = random(this.length); return (typeof (this[rand]) == "number") ? this[rand] : this.pickNumber(); }; Array.prototype.pickString = function():String { var rand:Number = random(this.length); return (typeof (this[rand]) == "string") ? this[rand] : this.pickString(); }; var myArray:Array = new Array("Hello", "ActionScript", 3, 7, 11, "Flash"); var num:Number = myArray.pickNumber(); var str:String = myArray.pickString(); _root.createTextField("txt", 1, 10, 10, 530, 390); txt.text = "Array = " + myArray + "nRandom Number = " + num + "nRandom String = " + str; 

Array and dataProvider example:

 var aData:Array = [{name: "J. Bell", age: "55"}, {name: "B. Longman", age: "21"}]; dataGrid.dataProvider = aData; 

ActionScript 3.0 examples

This Hello World example uses ActionScript 3.0:

 package { import flash.display.Sprite; import flash.text.TextField; import flash.filters.DropShadowFilter; public class HelloWorld2 extends Sprite { public function HelloWorld2() { var shad:DropShadowFilter = new DropShadowFilter (2, 45, 0x000000, 25, 3, 3, 2, 2); var txt:TextField = new TextField(); txt.textColor = 0xFFFFFF; txt.filters = [shad]; txt.width = 200; txt.x = Math.random() * 300; txt.y = Math.random() * 300; txt.selectable = false; txt.text = "Hello World welcome! [" + Math.round(txt.x) + "," + Math.round(txt.y) + "]"; addChild(txt); } } } 

Data structures

Data types

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

  • String - A list of characters such as "Hello World"
  • Number - Any Numeric value
  • Boolean - A simple binary storage that can only be "true" or "false".
  • Object - Object is the data type all complex data types inherit from. It allows for the grouping of methods, functions, parameters, and other objects.

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 these data types are:

  • MovieClip - An ActionScript creation that allows easy usage of visible objects.
  • TextField - A simple dynamic or input text field. Inherits the Movieclip type.
  • Button - A simple button with 4 frames (states): Up, Over, Down and Hit. Inherits the MovieClip type.
  • Date - Allows access to information about a specific point in time.
  • Array - Allows linear storage of data.
  • XML - An XML object
  • XMLNode - An XML node
  • LoadVars - A Load Variables object allows for the storing and send of HTTP POST and HTTP GET variables
  • Sound
  • NetStream
  • NetConnection
  • MovieClipLoader
  • EventListener

ActionScript 3 top level data types (see Data type descriptions)

  • Boolean - The Boolean data type has only two possible values: true and false. No other values are valid.
  • int - The int data type is a 32-bit integer between -2,147,483,648 and 2,147,483,647.
  • Null - The Null data type contains only one value, null. This is the default value for the String data type and all classes that define complex data types, including the Object class.
  • Number - The Number data type can represent integers, unsigned integers, and floating-point numbers. The Number data type uses the 64-bit double-precision format as specified by the IEEE Standard for Binary Floating-Point Arithmetic (IEEE-754).
  • String - The String data type represents a sequence of 16-bit characters. Strings are stored internally as Unicode characters, using the UTF-16 format. Previous versions of flash used the UTF-8 format.
  • uint - The uint (Unsigned Integer) data type is a 32-bit unsigned integer between 0 and 4,294,967,295.
  • void - The void data type contains only one value, undefined. In previous versions of ActionScript, undefined was the default value for instances of the Object class. In ActionScript 3.0, the default value for Object instances is null.

ActionScript 3 complex data types (see Data type descriptions)

  • Object - The Object data type is defined by the Object class. The Object class serves as the base class for all class definitions in ActionScript.
  • Array - Contains a list of data. Though ActionScript 3 is a strongly-typed language, it does not support typed Arrays. Thus the contents of an Array may be of any type.
  • Date
  • Error
  • Function
  • RegExp
  • XML
  • XMLList

Using data types

Using these data types in ActionScript is quite simple. 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(); 

Some types are automatically put in place:

 var MyString = "Hello Wikipedia!"; // This would automatically set the variable as a string. var MyNumber = 5; // This would do the same for a number. var MyObject = {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 = [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}. 

Footnotes

  1. ^ RFC 4329
  2. ^ Note that the name "ActionScript 1.0" is a retronym, coined after the release of ActionScript 2.0.
  3. ^ Note that this is also valid ActionScript "1.0", the original scripting language of Flash. However, it does not produce a visible text box in Flash Player versions lower than 6, as an embedded font is required.

A retronym is a type of neologism coined for an old object or concept whose original name has come to be used for something else, is no longer unique, or is otherwise inappropriate or misleading. ... Macromedia Flash or Flash is a graphics animation program, written and marketed by Macromedia, that uses vector graphics. ...

See also

ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... Adobe Flash, or simply Flash, refers to both the Adobe Flash Player, and to the Adobe Flash Professional multimedia authoring program. ... The Adobe Flush Player is a widely distributed multimedia and application player created and distributed by Macromedia (a division of Adobe Systems). ... Adobe Flash Lite is a lightweight version of Adobe Flash Player optimized for mobile phones and other devices. ... Adobe Integrated Runtime (AIR), codenamed and originally named Apollo[1], is a cross-OS runtime environment for building Rich Internet Applications, using Flash, Flex, HTML, Ajax, that can be deployed as a desktop application. ... Adobe Flex is a collection of technologies released by Adobe Systems for the development and deployment of cross platform, rich Internet applications based on the proprietary Adobe Flash platform. ... This article is about the proprietary file format . ... Tamarin is a free virtual machine and just in time compiler intended to implement the fourth edition of the ECMAScript standard, commonly referred to as JavaScript 2. ... Macromedia was an American graphics and web development software house headquartered in San Francisco, California producing such products as Macromedia Flash. ... Adobe Systems (pronounced a-DOE-bee IPA: ) (NASDAQ: ADBE) (LSE: ABS) is an American computer software company headquartered in San Jose, California, USA. Adobe was founded in December 1982[1] by John Warnock and Charles Geschke, who established the company after leaving Xerox PARC in order to develop and sell...

External links

Wikibooks
Wikibooks has a book on the topic of

Image File history File links Wikibooks-logo-en. ... Wikibooks logo Wikibooks, previously called Wikimedia Free Textbook Project and Wikimedia-Textbooks, is a wiki for the creation of books. ...

Adobe documentation and references

Developer community sites

Adobe Flash, or simply Flash, refers to both the Adobe Flash Player, and to the Adobe Flash Professional multimedia authoring program. ...

Tools and scripts


  Results from FactBites:
 
ActionScript: Information from Answers.com (1535 words)
Since both ActionScript and JavaScript are based on the same ECMAScript syntax, fluency in one theoretically translates easily to the other.
ActionScript first appeared in its current syntax with the release of Flash 5, which was the first thoroughly programmable version of Flash.
Flash's ActionScript VM tends to hit a ceiling quickly in regards to the amount of computation that ActionScript can perform before triggering an internal timeout, especially on the Mac Flash Player.
||| Flash MX 2004 - Flash News, Tutorials and Reviews ||| (1842 words)
The ActionScript that you've been writing in Flash 5 and Flash MX is now referred to as ActionScript 1.0.
ActionScript 2.0 is a new feature included in both Flash MX 2004 and Flash MX Professional 2004, and in most respects it is very much the same language as ActionScript 1.0.
ActionScript 1.0 tends to lend itself to poor programming practices…and to mistakes of assigning incorrect data types to variables.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.