Display Objects
Big changes in ActionScript 3.0 are about handling and working with display objects. While ActionScript 2.0 we only knew MovieClip, Graphic and Button, now there are additional display object instances as :
- Sprite (just alike MovieClip but without frame inside it)
- Shape (alike the Sprite, minus the mouse and keyboard interactive)
- Bitmap (only to displays bitmap)
- Loader (as a container for loaded content like SWF or images(bitmaps)
And as previously, each display objects hold properties we can access through our script. ActionScript 3.0 still have the properties we used to know, but have slight changes in the naming, mostly are the name that using underscore like _x, _y, _width, _height, etc and now simply x, y, width, height, etc. Some of this properties are not only changed in naming, but also how the value represent. For example :
//ActionScript 2.0 mymovie._x = 100;// x position value = 100 mymovie._xscale = 200;// x scaling to 200% mymovie._alpha = 10;// alpha channel to 10% //ActionScript 3.0 mymovie.x = 100;// x position value = 100 mymovie.xscale = 2;// x scaling to 200% mymovie.alpha = 0.1// alpha channel to 10%
For button symbols now are instances of a new class, SimpleButton and Graphics become Shape. And dynamic text become instances of TextField. ActionScript 3.0 now will not allow us to place code inside Button or MovieClip. All code must be written in timelines or sepparate ActionScript files.