Learning AS3: * new variable types
AS3 there are many new types of data. Some of these types are not previously happen. AS3 in the basic data types are as follows:
Simple data types:
Boolean
Int
Null
Number
String
Uint
Undefined complex data type:
Object
Array
Date
Error
Function
RegExp
XML
XMLList new data types defined by type, such as: Matrix (flash.geom.Matrix)
Shape (flash.display.Shape) URLRequest (flash.net.URLRequest)
And so on.
NOTE:
Void in AS3 special type was changed all lowercase: void.
"*" Can be used to represent all data types. As follows:
Var anything: *; AS3 in the XML and AS1 and AS2 in completely different. Before the XML type (object) is defined as XMLObject. AS3 is the XML standard E4X-based XML object.
Int uint is the number and type of new expansion, said cosmetic surgery int (No decimals), the unit is unsigned integers (it is not the metric system, it is not negative). Use than the use of type int Number can slightly increase operating efficiency, and uint type should only be used in places, such as color.
* Object Show
AS3 is a new collection: display objects. This set contains all can be seen on the stage or can be added to the display list of targets, including the former MovieClip, textField button and the object. AS3 display objects:
AVM1Movie
Bitmap
Loader
MorphShape *
MovieClip
Shape
SimpleButton
Sprite
StaticText *
TextField
* Video of the object that this must be manually created on the stage, not directly through the creation of AS.
AVM1Movie using AS1 and AS2 created Movie, Movie AS3 created through AVM2 to play. So with AS1 and AS2 created in AVM2 Movie been targeted as a show to play. However, we can not and the use of AS.
Bitmaps are bitmap object. BitmapData object can be passed to specify effect, but also through the bitmap file can be set.
Loader object to the external load and display the image swf videos and documents.
MorphShapes created in the time frame graphics. Although AS can not be created, but can be invoked to AS and control.
MovieClips everyone would use
Shapes is separated from MovieClip only a graphics object graphics containers. In shape can be targeted through the use of graphics API graphics rendering all graphics. Replace the use of shape memory MovieClip burden can be reduced.
Sprite is not Timeline MovieClip in the use of AS3, may be used in many places instead of MovieClip sprite, especially in the creation of custom components at the show.
StaticText and MorphShapes, created through AS, which is created in the time frame of the text object.
TextField, text objects.
Video object, flash video player.
* New import logo
AS3 logo and the import of a number of different AS2. In AS2, import agents were used to invoke the name of the category in the category is not necessary. Therefore, in AS2, if you do not use import, you can also use the name of the long quote, for example:
/ / ActionScript 2
Var myPoint: new flash.geom.Point flash.geom.Point = (0,0); AS3, import logo is a must visit of the logo. To the use of other types of time, that can be used like a long name, but can not import omitted. For example:
/ / ActionScript 3
Import flash.geom.Point;
Var myPoint: new flash.geom.Point flash.geom.Point = (0,0); and AS2, Wildcards can be used in import (*) to import the entire package:
Import flash.geom .*;
Tags: css learning






Leave a Reply