Name

MovieClip “Class” — class-like datatype for main movies and movie clips

Availability

Flash 3 and later

Constructor

None. Movie clip symbols are created manually in the Flash authoring tool. Movie clip instances can be created with attachMovie( ) and duplicateMovieClip( ).

Properties

Movie clip properties provide descriptions of, and control over, various physical features of movie clips and main movies. Properties are accessed using the dot operator, as with any object. See Section 13.1 in Chapter 13, for details on using movie clip properties.

Two property-related issues to note:

  • Changing a physical property of a MovieClip object places that clip under programmatic control, breaking the internal timeline’s hold on it. This halts any tween currently in progress.

  • Some MovieClip properties appear to be floating-point numbers but are mapped to other formats internally. The _alpha property, for example, is mapped to an integer between 0 and 255 internally. This results in a loss of precision between setting and retrieving values of certain properties. We may, for example, set a property value to 90 and then immediately retrieve the value back as 89.84375. If minor variations in property values make a difference to a script, we must manually round those values using Math.round( ), Math.floor( ), or Math.ceil( ) after retrieval, or we must store the original value in a variable separate from the property.

Table 20.9 lists the movie clip properties. Note that all built-in movie clip properties ...

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.