home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeActionScript: The Definitive GuideSearch this book

13.7. Built-in Movie Clip Properties

Unlike generic objects of the Object class, which have few built-in properties, each movie clip comes equipped with a slew of built-in properties. These properties describe, and can be used to modify, the clip's physical features. They are fundamental tools in the ActionScript programmer's toolkit.

All built-in movie clip property names begin with an underscore, which sets them apart from user-defined or custom properties. Built-in properties take the format:

_ property

Built-in property names should be written in lowercase. However, because identifiers are case insensitive in ActionScript, it is possible -- though not good form -- to capitalize property names.

We're not going to go into heavy descriptions of the built-in properties right now; that information is listed in Part III, "Language Reference". However, to get us thinking about properties and what they offer, Table 13-1 provides a list of the built-in movie clip properties and basic descriptions of their functions.

Table 13-1. The Built-in Movie Clip Properties

Property Name

Property Description

_alpha

Transparency level

_currentframe

Position of the playhead

_droptarget

Path to the clip or movie on which a dragged clip was dropped

_framesloaded

Number of frames downloaded

_height

Physical height, in pixels (of instance, not original symbol)

_name

Clip's identifier, returned as a string

_ parent

Object reference to the timeline containing this clip

_rotation

Angle of rotation (in degrees)

_target

Full path to the clip, in slash notation

_totalframes

Number of frames in the timeline

_url

Network location of .swf

_visible

Boolean indicating whether movie clip is displayed

_width

Physical width, in pixels (of instance, not original symbol)

_x

Horizontal position, in pixels, from the left of the Stage

_xmouse

Horizontal location of the mouse pointer in the clip's coordinate space

_xscale

Horizontal size, as a percentage of the original symbol (or main timeline for movies)

_ y

Vertical position, in pixels, from the top of the Stage

_ ymouse

Vertical location of the mouse pointer in the clip's coordinate space

_ yscale

Vertical size, as a percentage of the original symbol (or main timeline for movies)

There's no direct color property attached to instances or main movies. Instead of controlling color through a property, we must use the Color class to create an object that is used to control the color of a clip. The methods of a Color object let us set or examine the RGB values and transformations of a particular clip. To learn the specific details, see the Reference 20.22 in Part III, "Language Reference".



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.