THE FLASH 4 BIBLE (IDG BOOKS)  back to
FLASH 4 ACTIONSCRIPT PROPERTIES  

movie and movie clip properties

GetProperty Name

Set Property Name

Property Of

Definition

_x

X Position

MC

The horizontal distance between a Movie Clip’s center point and the top left corner of the stage upon which it resides. Increases as the clip moves to the right. Measured in pixels.

_y

Y Position

MC

The vertical distance between a Movie Clip’s center point and the top left corner of the stage upon which it resides. Increases as the clip moves downward. Measured in pixels.

_width

MC, Movie

Returns the width, in pixels, of a movie clip or the main movie stage. Determined not by the width of the canvas but by the width of the space occupied by objects on the stage (meaning it can be less or greater than the canvas width set in Movie Properties).

_height

MC, Movie

Returns the height, in pixels, of a movie clip or the main movie stage. Determined not by the height of the canvas but by the height of the space occupied by objects on the stage.

_rotation

Rotation

MC

The amount, in degrees, a Movie Clip is rotated off plumb. Returns values set both by the rotation tool and with Set Property. Warning: setting the rotation property of a Movie Clip instance also scales that instance down slightly. Routines that spin an object should be written to compensate for this bug.

_target

MC

Returns the exact string you’d use to refer to the Movie Clip instance with a Tell Target Action.

_name

Name

MC

Returns or reassigns the Movie Clip instance’s name (as listed under Instance Properties).

_url

MC, Movie

Returns the complete path to the .swf file in which the Action is executed, including the name of the .swf itself. Could be used to prevent a movie from being viewed if not on a particular server.

_xscale

X Scale

MC, Movie

The width of a Movie Clip instance (or movie) as a percentage of the parent’s actual size.

_yscale

Y Scale

MC, Movie

The height of a Movie Clip instance (or movie) as a percentage of the parent’s actual size.

_currentframe

MC, Movie

Returns the number of the current frame (ie. the frame on which the playhead currently resides) of the movie or a Movie Clip instance.

_totalframes

MC, Movie

Returns the number of total frames in a movie or Movie Clip instance’s timeline.

_framesloaded

Movie

Returns the number of frames that have downloaded over the network.

_alpha

Alpha

The amount of transparency of a Movie Clip or movie. Measured as a percentage: 100 is completely opaque, 0 is completely transparent.

_visible

Visibility

MC, Movie

A boolean value which indicates whether a Movie Clip instance is shown or hidden. Set to 1 to show, 0 to hide. Buttons in “hidden” movies are not active.

_droptarget

MC

Returns the name of the last Movie Clip upon which a draggable Movie Clip was dropped. For usage, see “Drag’n’Drop in Flash” in Chapter 14.

_highquality

High quality

Movie

The visual quality setting of the movie. 1=Low, 2=High, 3=Best. For details, see “Toggle High Quality” in Chapter 13.

_focusrect

Show focus rectangle

Movie

A boolean value which indicates whether a yellow rectangle is shown around buttons when accessed via the TAB key. Default is to show. When set to 0, the Up state of the button is shown instead of the yellow rectangle.

_soundbuftime

Sound buffer time

Movie

The number of seconds a sound should pre-load before it begins playing. Default is 5 seconds.

.scroll

Text Field Variable

The topmost displayed line in the viewable region of a text-field variable. May be set with Set Variable, eg. Set Variable: "var1.scroll"="3"

.maxscroll

Text Field Variable

Returns the number of the lowest line that may be displayed as the top line in the viewable region of a text-field variable. Retrievable by simply stating the variable name and appending the .maxscroll command, as in var1.maxscroll.

using getproperty
GetProperty is not available as an Action, but must be typed in as an expression anywhere an expression is allowed. It takes the following syntax: GetProperty ( target, _propertyname ). The target is the full path to the name of the Movie Clip instance or Level which is being inspected. Target must be surrounded by quotation marks. Eg. GetProperty ( "/testmovie", _x ). For more information on constructing target paths, see "Controlling Movie Clips with Tell Target" in Chapter 14.

using set property
To set a property of a Movie Clip or movie, add a Set Property Action using the plus (+) button on the Actions tab. Choose the property you wish to set using the Set drop-down menu, then specify the target movie or Movie Clip instance in the Target text-field (the target, which can be an expression, is the same as it would be for a Tell Target Action). Finally, enter the value of the property in the Value text-field. If the assigned value is an expression (i.e. contains calculations or variables), remember to set the "abc" button to expression (see Expressions). GetProperty can be used in combination with Set Property to alter a movie or Movie Clip instance relative to its original state. For instance, the following code would double the current width of the Movie Clip instance named testmc:

Set Property ("/testmc", X Scale) = GetProperty ("/testmc", _xscale) * 2

 

about this info
this documentation is a short excerpt from colin moock's section of the 600 page book "the flash 4 bible", (idg books). to order, or for general information about the book, visit colin's flash 4 bible page.

revision history
november 30, 1999: created.
december 1, 1999: posted.
april 19, 2000: fixed typo in example code (was _x, is now _xscale). thanks to hc for pointing that out.