Using Objects in ActionScript > Using objects in ActionScript overview |
![]() |
Using objects in ActionScript overview
The ActionScript in Macromedia Flash MX provides enhanced object support that improves the integration of movie clips, buttons, and text fields into the ActionScript object model.
In Macromedia Flash 5 ActionScript, movie clips were always assigned to the class MovieClip. The MovieClip class does not support prototype-based inheritance, so it was not possible to extend movie clips with additional properties and methods using the prototype system. In Macromedia Flash MX, movie clips can be assigned to an object class. Since object classes support prototype-based inheritance, it is now possible to extend movie clips with additional properties and methods using the prototype system.
Buttons could not be represented as objects in Macromedia Flash 5 ActionScript. In Macromedia Flash MX ActionScript, buttons can be assigned instance names, and are reflected in ActionScript as objects, controlled by methods. Similarly, text fields were represented only as variable names in Macromedia Flash 5 ActionScript. In Macromedia Flash MX ActionScript, text fields can be assigned instance names, and are reflected in ActionScript as objects, controlled by methods. Both Button and TextField objects support the same properties as MovieClip objects, with the exception of the _currentframe
, _droptarget
, _framesloaded
, and _totalframes
properties. You can get and set properties and invoke methods for buttons and text fields. You can also create text fields dynamically.
![]() |