Name
MovieClip._xscale Property — width of a clip or movie, as a percentage
Availability
Flash 4 and later
Synopsis
mc._xscale
Access
Read/write
Description
The floating-point _xscale
property specifies the
width of mc
relative to its original
width, expressed as a percentage. If mc
is
an instance, its “original width” is the width of the
instance’s symbol in the Library. If
mc
is a main movie, its “original
width” is the width of the movie at authoring time.
When the current width of mc
is the same
as its original width, _xscale
is 100. An
_xscale
of 200 doubles
mc
’s width relative to its original
width. An _xscale
of 50 halves
mc
’s width relative to its original
width.
The _xscale
property scales a clip about its
registration point (proportionately on the right and left sides of
the clip’s registration point). To size a clip from one side
only, place all of the clip’s content on one side of the
registration point in the clip’s symbol (this is a useful
technique for creating horizontal preloader bars). When a
clip’s _xscale
is set to a negative value,
the clip is flipped horizontally as if across a vertical mirror
running through its registration point (i.e., it becomes a mirror
image of itself), after which the negative value is treated as a
positive. To flip a clip horizontally without resizing it, set the
clip’s _xscale
to -100.
Example
// Double the width of ball (the height remains unchanged) ball._xscale *= 2; // Create a mirror image of ball ball._xscale = -100;
See Also
MovieClip._ ...
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.