Working with Movie Clips > Using actions and methods to control Timelines > Changing movie clip position and appearance
Changing movie clip position and appearance
To change the properties of a movie clip as it plays, you can use the setProperty
action or write a statement that assigns a value to a property. If you load a movie into a target, the loaded movie inherits the properties of the targeted movie clip. Once the movie is loaded, you can change those properties.
Some properties, called read-only properties, have values that you can read but not set. You can write statements to set any property that is not read-only. The following statement sets the _alpha
property of the movie clip instance wheel
, which is a child of the car
instance:
car.wheel._alpha = 50;
In addition, you can write statements that get the value of a movie clip property. For example, the following statement gets the value of the _xmouse
property on the main Timeline and sets the _x
property
of the customCursor
instance to that value:
onClipEvent(enterFrame){ customCursor._x = _root._xmouse; }
You can also use the getProperty
function to retrieve movie clip properties.
The _alpha _highquality _totalframes _xscale _currentframe _name _url _y _droptarget _quality _visible _ymouse _focusrect _rotation _width _yscale _framesloaded _soundbuftime _x _height _target _xmouse_x
, _y
, _rotation
, _xscale
, _yscale
, _height
, _width
, _alpha
, and _visible
properties are affected by transformations on the movie clip's parent, and transform the movie clip and any of the clip's children. The _focusrect
, _highquality
, _quality
, and _soundbuftime
properties are global; they only belong to the level 0 Timeline. All other properties belong to each movie clip or loaded level. The table below lists all the movie clip properties:
Properties