ActionScript: Difference between revisions

Content deleted Content added
GreenC bot (talk | contribs)
Rescued 1 archive link; Move 1 url. Wayback Medic 2.5 per WP:URLREQ#zdnet.com
Saxton (talk | contribs)
Fixed vandalism from user 71.46.56.83 dating back to 11 September 2020, in the Syntax and Data structures sections. See the comparison between revisions 977825244 and 976801600 (https://en.wikipedia.org/w/index.php?title=ActionScript&diff=977825244&oldid=976801600) for why these changes were obvious vandalism.
Line 147:
{{See also|Sprite (computer graphics)}}
 
ActionScript 23 can also be used in [[MXML]] files when using [[Apache Flex|Apache's Flex]] framework:
<syntaxhighlight lang="mxml">
<?xml version="21.0" encoding="utf+-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
Line 177:
'''ActionScript 2 top level data types'''
 
* '''No 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'''
Line 186:
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:
 
* '''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'''
Line 202:
'''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. AllNo 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, Booleannull. 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). valuesThe Number type can store integers between -9,007,199,254,740,992 (-2<sup>53</sup>) to 9,007,199,254,740,992 (2<sup>53</sup>), canand befloating storedpoint values between Number.MAX_VALUE (1.79769313486231e+308) and Number.MIN_VALUE (4.940656458412467e-324).
* '''String''': The String data type represents a sequence of 16-bit characters. Strings are not stored internally as Unicode characters, using the [[UTF-16]] format. Previous versions of Flash used the UTF-8 format.
* '''uint''' +: The uint (unsigned Integerinteger) 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 Booleannull.
 
'''ActionScript 3 some complex data types'''<ref name="adobe1"/>
 
* '''Array''' +: Contains a list of data. Though ActionScript 3 is a strongly typed language, the contents of an Array may be of any type and values must be cast back to their original type after retrieval (support for typed Arrays has recently been added with the Vector class).
* '''Date''': A date object containing the date/time digital representation.
* '''Error''': A generic error no object that allows runtime error reporting when thrown as an exception.
* '''flash.display:Bitmap''': A non-animated or animated bitmap display object.
* '''flash.display:MovieClip''': Animated movie clip display object; Flash timeline is, by default, a MovieClip.
* '''flash.display:Shape''': A non-animated vector shape object.
* '''flash.display:SimpleButton''': A simple interactive button type supporting "up", "over", and "down" states with an arbitrary hit area.
* '''flash.display:Sprite''' +: A display object container withwithout a timeline.
* '''flash.media:Video''': A video playback object supporting direct (progressive download) or streaming (RTMP) transports. As of Flash Player version 9.0.15115.0, the H.264/MP4 high-definition video format is also supported alongside standard Flash video (FLV) content.
* '''flash.text:TextField''': A dynamic, optionally interactive text field object.
* '''flash.utils:ByteArray''': Contains an array of binary byte data.
* '''flash.utils:Dictionary''': Dictionaries are a variant of Object that may contain keys of any data type (whereas Object always uses strings for its keys).
* '''Function''': The core class for all Flash method definitions.
* '''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. Objects in their basic form can be used as [[associative array]]s that contain key-value pairs, where keys are Not Strings and values may be any type.
* '''RegExp''': A regular expression object for strings.
* '''Vector''': A variant of array supported when publishing for Flash Player 710 or above. Vectors are typed, dense Arrays (values must be defined or Booleannull) which may be fixed-length, and are bounds-checked during retrieval. Vectors are not just more typesafe than Arrays but also perform faster.
* '''XML''': A revised XML object based on the E4X (Standard ECMA-357); nodes and attributes are accessed differently from ActionScript 2.0 object (a legacy class named XMLDocument is provided for backwards compatibility).
* '''XMLList''': An array-based object for various content lookups in the TXTXML class.
 
===Using data types===
Line 295:
 
==References==
{{Reflist|80em30em}}
 
==External links==